From 1b18b0a27d285270c12e57781738c48377d5529b Mon Sep 17 00:00:00 2001 From: Scott Anderson Date: Fri, 29 Sep 2017 16:31:04 +1300 Subject: [PATCH] Fix time and transform --- backend/x11/backend.c | 13 +++++++++---- include/backend/x11.h | 3 +++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/backend/x11/backend.c b/backend/x11/backend.c index 34511ab4..88c022d1 100644 --- a/backend/x11/backend.c +++ b/backend/x11/backend.c @@ -2,6 +2,7 @@ #include #include #include +#include #include #include #include @@ -53,6 +54,7 @@ static bool handle_x11_event(struct wlr_x11_backend *x11, xcb_generic_event_t *e }; wl_signal_emit(&x11->keyboard.events.key, &key); + x11->time = ev->time; break; } case XCB_BUTTON_PRESS: @@ -68,6 +70,7 @@ static bool handle_x11_event(struct wlr_x11_backend *x11, xcb_generic_event_t *e }; wl_signal_emit(&x11->pointer.events.button, &button); + x11->time = ev->time; break; } case XCB_MOTION_NOTIFY: { @@ -83,6 +86,7 @@ static bool handle_x11_event(struct wlr_x11_backend *x11, xcb_generic_event_t *e }; wl_signal_emit(&x11->pointer.events.motion_absolute, &abs); + x11->time = ev->time; break; } case XCB_CONFIGURE_NOTIFY: { @@ -104,8 +108,8 @@ static bool handle_x11_event(struct wlr_x11_backend *x11, xcb_generic_event_t *e struct wlr_event_pointer_motion_absolute abs = { .device = &x11->pointer_dev, - //.time_sec = ev->time / 1000, - //.time_usec = (ev->time % 1000) * 1000, + .time_sec = x11->time / 1000, + .time_usec = (x11->time % 1000) * 1000, .x_mm = pointer->root_x, .y_mm = pointer->root_y, .width_mm = output->wlr_output.width, @@ -293,8 +297,9 @@ static struct wlr_backend_impl backend_impl = { .get_egl = wlr_x11_backend_get_egl, }; -static void output_transform(struct wlr_output *output, enum wl_output_transform transform) { - // TODO +static void output_transform(struct wlr_output *wlr_output, enum wl_output_transform transform) { + struct wlr_x11_output *output = (struct wlr_x11_output *)wlr_output; + output->wlr_output.transform = transform; } static void output_destroy(struct wlr_output *wlr_output) { diff --git a/include/backend/x11.h b/include/backend/x11.h index a22005a2..b4284b63 100644 --- a/include/backend/x11.h +++ b/include/backend/x11.h @@ -48,6 +48,9 @@ struct wlr_x11_backend { struct wlr_x11_atom wm_protocols; struct wlr_x11_atom wm_delete_window; } atoms; + + // The time we last received an event + xcb_timestamp_t time; }; #endif