diff options
-rw-r--r-- | include/xcwm/input.h | 4 | ||||
-rw-r--r-- | src/libxcwm/input.c | 11 | ||||
-rw-r--r-- | src/xtoq/XtoqController.m | 4 |
3 files changed, 9 insertions, 10 deletions
diff --git a/include/xcwm/input.h b/include/xcwm/input.h index 16d5916..fe9462f 100644 --- a/include/xcwm/input.h +++ b/include/xcwm/input.h @@ -41,12 +41,12 @@ xcwm_input_key_event(xcwm_context_t *context, uint8_t code, int state); /** * Send mouse button event to the X Server. - * @param window The window the event occurred in. + * @param context The context the event occurred in. * @param button The mouse button pressed. * @param state 1 if the mouse button is pressed down, 0 if released. */ void -xcwm_input_mouse_button_event(xcwm_window_t *window, +xcwm_input_mouse_button_event(xcwm_context_t *context, int button, int state); /** diff --git a/src/libxcwm/input.c b/src/libxcwm/input.c index 083b505..a678bfd 100644 --- a/src/libxcwm/input.c +++ b/src/libxcwm/input.c @@ -49,7 +49,7 @@ xcwm_input_key_event(xcwm_context_t *context, uint8_t code, int state) } void -xcwm_input_mouse_button_event(xcwm_window_t *window, +xcwm_input_mouse_button_event(xcwm_context_t *context, int button, int state) { int button_state; @@ -60,12 +60,11 @@ xcwm_input_mouse_button_event(xcwm_window_t *window, else { button_state = XCB_BUTTON_RELEASE; } - /* FIXME: Why are we passing a specifing window ID here, when - * other handlers use either the root window or none. */ - xcb_test_fake_input(window->context->conn, button_state, button, + + xcb_test_fake_input(context->conn, button_state, button, XCB_CURRENT_TIME, - window->window_id, 0, 0, 0); - xcb_flush(window->context->conn); + XCB_NONE, 0, 0, 0); + xcb_flush(context->conn); /* printf("Injected mouse event - button %d, state: %d\n", */ /* button, state); */ } diff --git a/src/xtoq/XtoqController.m b/src/xtoq/XtoqController.m index c482d82..02cb490 100644 --- a/src/xtoq/XtoqController.m +++ b/src/xtoq/XtoqController.m @@ -245,7 +245,7 @@ int buttonInt = [mouseButton intValue]; dispatch_async(xcwmDispatchQueue, - ^{ xcwm_input_mouse_button_event (window, + ^{ xcwm_input_mouse_button_event (rootContext, buttonInt, 1); ; @@ -270,7 +270,7 @@ int buttonInt = [mouseButton intValue]; dispatch_async(xcwmDispatchQueue, - ^{ xcwm_input_mouse_button_event (window, + ^{ xcwm_input_mouse_button_event (rootContext, buttonInt, 0); }); |