aboutsummaryrefslogtreecommitdiff
path: root/backend/x11
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2018-05-03 07:29:32 -0400
committerGitHub <noreply@github.com>2018-05-03 07:29:32 -0400
commit2964248f42568d7fae410072be30cee1981d6f96 (patch)
tree6cfe1fae9600d11db518eff055cc9c3bed42a0af /backend/x11
parent37d4ff90e771325d503221cb950c2c6ecf1475a0 (diff)
parent545d54439d8085d75e484079ee4e7ea6c9b892bc (diff)
Merge pull request #935 from agx/cursor-output-transform
wlr_cursor: transform absolute coordinates
Diffstat (limited to 'backend/x11')
-rw-r--r--backend/x11/input_device.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/backend/x11/input_device.c b/backend/x11/input_device.c
index f8b87630..75cfa76e 100644
--- a/backend/x11/input_device.c
+++ b/backend/x11/input_device.c
@@ -32,21 +32,11 @@ static void x11_handle_pointer_position(struct wlr_x11_output *output,
int16_t x, int16_t y, xcb_timestamp_t time) {
struct wlr_x11_backend *x11 = output->x11;
struct wlr_output *wlr_output = &output->wlr_output;
-
- struct wlr_box box = { .x = x, .y = y };
- wlr_box_transform(&box, wlr_output->transform, wlr_output->width,
- wlr_output->height, &box);
- box.x /= wlr_output->scale;
- box.y /= wlr_output->scale;
-
- int output_width, output_height;
- wlr_output_effective_resolution(wlr_output, &output_width, &output_height);
-
struct wlr_event_pointer_motion_absolute event = {
.device = &output->pointer_dev,
.time_msec = time,
- .x = (double)box.x / output_width,
- .y = (double)box.y / output_height,
+ .x = (double)x / wlr_output->width,
+ .y = (double)y / wlr_output->height,
};
wlr_signal_emit_safe(&output->pointer.events.motion_absolute, &event);