diff options
author | Drew DeVault <sir@cmpwn.com> | 2016-07-16 09:09:22 -0400 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2016-07-16 09:09:22 -0400 |
commit | 147a88260a74f536e1a1e513f0f8087d02982b00 (patch) | |
tree | bdd978690510d35a170399ee0d078c6a4ac5f64b | |
parent | e66f813d49e60728064fa563e01f00f7d99e0a08 (diff) |
Fix #753
-rw-r--r-- | include/client/window.h | 3 | ||||
-rw-r--r-- | swaybar/bar.c | 8 | ||||
-rw-r--r-- | wayland/window.c | 2 |
3 files changed, 8 insertions, 5 deletions
diff --git a/include/client/window.h b/include/client/window.h index e07e3509..296dd9ed 100644 --- a/include/client/window.h +++ b/include/client/window.h @@ -38,8 +38,7 @@ struct pointer_input { int last_x; int last_y; - void (*notify_button)(struct window *window, int x, int y, uint32_t button); - + void (*notify_button)(struct window *window, int x, int y, uint32_t button, uint32_t state_w); void (*notify_scroll)(struct window *window, enum scroll_direction direction); }; diff --git a/swaybar/bar.c b/swaybar/bar.c index 82e136e4..9009e1ff 100644 --- a/swaybar/bar.c +++ b/swaybar/bar.c @@ -58,8 +58,12 @@ struct output *new_output(const char *name) { return output; } -static void mouse_button_notify(struct window *window, int x, int y, uint32_t button) { - sway_log(L_DEBUG, "Mouse button %d clicked at %d %d\n", button, x, y); +static void mouse_button_notify(struct window *window, int x, int y, + uint32_t button, uint32_t state_w) { + sway_log(L_DEBUG, "Mouse button %d clicked at %d %d %d\n", button, x, y, state_w); + if (!state_w) { + return; + } struct output *clicked_output = NULL; for (int i = 0; i < swaybar.outputs->length; i++) { diff --git a/wayland/window.c b/wayland/window.c index dfa6a997..9ebee2ba 100644 --- a/wayland/window.c +++ b/wayland/window.c @@ -42,7 +42,7 @@ static void pointer_handle_button(void *data, struct wl_pointer *pointer, uint32 struct pointer_input *input = &window->pointer_input; if (window->pointer_input.notify_button) { - window->pointer_input.notify_button(window, input->last_x, input->last_y, button); + window->pointer_input.notify_button(window, input->last_x, input->last_y, button, state_w); } } |