mirror of
https://github.com/swaywm/sway.git
synced 2024-12-01 10:56:36 +00:00
Fix #753
This commit is contained in:
parent
e66f813d49
commit
147a88260a
|
@ -38,8 +38,7 @@ struct pointer_input {
|
||||||
int last_x;
|
int last_x;
|
||||||
int last_y;
|
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);
|
void (*notify_scroll)(struct window *window, enum scroll_direction direction);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -58,8 +58,12 @@ struct output *new_output(const char *name) {
|
||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void mouse_button_notify(struct window *window, int x, int y, uint32_t button) {
|
static void mouse_button_notify(struct window *window, int x, int y,
|
||||||
sway_log(L_DEBUG, "Mouse button %d clicked at %d %d\n", button, x, 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;
|
struct output *clicked_output = NULL;
|
||||||
for (int i = 0; i < swaybar.outputs->length; i++) {
|
for (int i = 0; i < swaybar.outputs->length; i++) {
|
||||||
|
|
|
@ -42,7 +42,7 @@ static void pointer_handle_button(void *data, struct wl_pointer *pointer, uint32
|
||||||
struct pointer_input *input = &window->pointer_input;
|
struct pointer_input *input = &window->pointer_input;
|
||||||
|
|
||||||
if (window->pointer_input.notify_button) {
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue