diff options
author | Drew DeVault <sir@cmpwn.com> | 2017-10-30 15:50:31 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-30 15:50:31 -0400 |
commit | ebca06bfe46d18763c79f99382ce7c9717b538a6 (patch) | |
tree | 171dfa1636c409cc5b4fbf8f5ddadea035e99a3d /backend/x11/backend.c | |
parent | 2e7cfd21e4c884910a703fab44009ba18c20f002 (diff) | |
parent | 875a5b446fcf04314ee102624bda7ae18939837e (diff) |
Merge pull request #358 from acrisci/refactor/sec-to-msec
refactor input time_sec to time_msec
Diffstat (limited to 'backend/x11/backend.c')
-rw-r--r-- | backend/x11/backend.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/backend/x11/backend.c b/backend/x11/backend.c index 0e98b8d9..9d7e252a 100644 --- a/backend/x11/backend.c +++ b/backend/x11/backend.c @@ -50,8 +50,7 @@ static bool handle_x11_event(struct wlr_x11_backend *x11, xcb_generic_event_t *e case XCB_KEY_RELEASE: { xcb_key_press_event_t *ev = (xcb_key_press_event_t *)event; struct wlr_event_keyboard_key key = { - .time_sec = ev->time / 1000, - .time_usec = ev->time * 1000, + .time_msec = ev->time, .keycode = ev->detail - 8, .state = event->response_type == XCB_KEY_PRESS ? WLR_KEY_PRESSED : WLR_KEY_RELEASED, @@ -71,8 +70,7 @@ static bool handle_x11_event(struct wlr_x11_backend *x11, xcb_generic_event_t *e double delta = (ev->detail == XCB_BUTTON_INDEX_4 ? -15 : 15); struct wlr_event_pointer_axis axis = { .device = &x11->pointer_dev, - .time_sec = ev->time / 1000, - .time_usec = ev->time * 1000, + .time_msec = ev->time, .source = WLR_AXIS_SOURCE_WHEEL, .orientation = WLR_AXIS_ORIENTATION_VERTICAL, .delta = delta, @@ -90,8 +88,7 @@ static bool handle_x11_event(struct wlr_x11_backend *x11, xcb_generic_event_t *e ev->detail != XCB_BUTTON_INDEX_5) { struct wlr_event_pointer_button button = { .device = &x11->pointer_dev, - .time_sec = ev->time / 1000, - .time_usec = ev->time * 1000, + .time_msec = ev->time, .button = xcb_button_to_wl(ev->detail), .state = event->response_type == XCB_BUTTON_PRESS ? WLR_BUTTON_PRESSED : WLR_BUTTON_RELEASED, @@ -106,8 +103,7 @@ static bool handle_x11_event(struct wlr_x11_backend *x11, xcb_generic_event_t *e xcb_motion_notify_event_t *ev = (xcb_motion_notify_event_t *)event; struct wlr_event_pointer_motion_absolute abs = { .device = &x11->pointer_dev, - .time_sec = ev->time / 1000, - .time_usec = ev->time * 1000, + .time_msec = ev->time, .x_mm = ev->event_x, .y_mm = ev->event_y, .width_mm = output->wlr_output.width, @@ -135,8 +131,7 @@ 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 = x11->time / 1000, - .time_usec = x11->time * 1000, + .time_msec = x11->time, .x_mm = pointer->root_x, .y_mm = pointer->root_y, .width_mm = output->wlr_output.width, |