diff options
author | Uli Schlachter <psychon@znc.in> | 2018-04-15 10:33:53 +0200 |
---|---|---|
committer | Uli Schlachter <psychon@znc.in> | 2018-04-15 10:33:53 +0200 |
commit | 98f8ec6a081b215f901a47226c39797260a7d1e1 (patch) | |
tree | 3b753549029ff99e3709b412dc691bb602316500 /backend/x11 | |
parent | 3728abd1fc325bccf02499e3e363791d6f986ebc (diff) |
x11_handle_input_event: Remove return value
handle_x11_event() and x11_handle_input_event() react to different kinds
of events, so it does not make much of a difference if
x11_handle_input_event() signals if it handled an event or not.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Diffstat (limited to 'backend/x11')
-rw-r--r-- | backend/x11/backend.c | 4 | ||||
-rw-r--r-- | backend/x11/input_device.c | 18 |
2 files changed, 8 insertions, 14 deletions
diff --git a/backend/x11/backend.c b/backend/x11/backend.c index 64c6973b..768d00f7 100644 --- a/backend/x11/backend.c +++ b/backend/x11/backend.c @@ -67,9 +67,7 @@ void x11_output_layout_get_box(struct wlr_x11_backend *backend, static void handle_x11_event(struct wlr_x11_backend *x11, xcb_generic_event_t *event) { - if (x11_handle_input_event(x11, event)) { - return; - } + x11_handle_input_event(x11, event); switch (event->response_type & XCB_EVENT_RESPONSE_TYPE_MASK) { case XCB_EXPOSE: { diff --git a/backend/x11/input_device.c b/backend/x11/input_device.c index 55e543e6..4433568d 100644 --- a/backend/x11/input_device.c +++ b/backend/x11/input_device.c @@ -56,7 +56,7 @@ static void x11_handle_pointer_position(struct wlr_x11_output *output, x11->time = time; } -bool x11_handle_input_event(struct wlr_x11_backend *x11, +void x11_handle_input_event(struct wlr_x11_backend *x11, xcb_generic_event_t *event) { switch (event->response_type & XCB_EVENT_RESPONSE_TYPE_MASK) { case XCB_KEY_PRESS: @@ -73,7 +73,7 @@ bool x11_handle_input_event(struct wlr_x11_backend *x11, // TODO use xcb-xkb for more precise modifiers state? wlr_keyboard_notify_key(&x11->keyboard, &key); x11->time = ev->time; - return true; + return; } case XCB_BUTTON_PRESS: { xcb_button_press_event_t *ev = (xcb_button_press_event_t *)event; @@ -110,19 +110,17 @@ bool x11_handle_input_event(struct wlr_x11_backend *x11, wlr_signal_emit_safe(&x11->pointer.events.button, &button); } x11->time = ev->time; - return true; + return; } case XCB_MOTION_NOTIFY: { xcb_motion_notify_event_t *ev = (xcb_motion_notify_event_t *)event; struct wlr_x11_output *output = x11_output_from_window_id(x11, ev->event); - if (output == NULL) { - return false; + if (output != NULL) { + x11_handle_pointer_position(output, ev->event_x, ev->event_y, ev->time); } - - x11_handle_pointer_position(output, ev->event_x, ev->event_y, ev->time); - return true; + return; } default: #ifdef WLR_HAS_XCB_XKB @@ -131,13 +129,11 @@ bool x11_handle_input_event(struct wlr_x11_backend *x11, (xcb_xkb_state_notify_event_t *)event; wlr_keyboard_notify_modifiers(&x11->keyboard, ev->baseMods, ev->latchedMods, ev->lockedMods, ev->lockedGroup); - return true; + return; } #endif break; } - - return false; } const struct wlr_input_device_impl input_device_impl = { 0 }; |