diff options
Diffstat (limited to 'src/lib/ecore_wayland')
-rw-r--r-- | src/lib/ecore_wayland/ecore_wl_input.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/lib/ecore_wayland/ecore_wl_input.c b/src/lib/ecore_wayland/ecore_wl_input.c index 6219a033e2..e36f47d1cb 100644 --- a/src/lib/ecore_wayland/ecore_wl_input.c +++ b/src/lib/ecore_wayland/ecore_wl_input.c | |||
@@ -164,12 +164,13 @@ ecore_wl_input_ungrab(Ecore_Wl_Input *input) | |||
164 | 164 | ||
165 | if (!input) return; | 165 | if (!input) return; |
166 | 166 | ||
167 | if ((input->grab) && (input->grab_button)) | 167 | if ((input->grab) && (input->grab_button) && (input->grab_count)) |
168 | _ecore_wl_input_mouse_up_send(input, input->grab, 0, input->grab_button, | 168 | _ecore_wl_input_mouse_up_send(input, input->grab, 0, input->grab_button, |
169 | input->grab_timestamp); | 169 | input->grab_timestamp); |
170 | 170 | ||
171 | input->grab = NULL; | 171 | input->grab = NULL; |
172 | input->grab_button = 0; | 172 | input->grab_button = 0; |
173 | input->grab_count = 0; | ||
173 | } | 174 | } |
174 | 175 | ||
175 | /* NB: This function should be called just before shell move and shell resize | 176 | /* NB: This function should be called just before shell move and shell resize |
@@ -622,8 +623,8 @@ _ecore_wl_input_cb_pointer_button(void *data, struct wl_pointer *pointer EINA_UN | |||
622 | _ecore_wl_input_mouse_up_send(input, input->pointer_focus, | 623 | _ecore_wl_input_mouse_up_send(input, input->pointer_focus, |
623 | 0, button, timestamp); | 624 | 0, button, timestamp); |
624 | 625 | ||
625 | input->grab_count--; | 626 | if (input->grab_count) input->grab_count--; |
626 | if ((input->grab) && (input->grab_button == button) && | 627 | if ((input->grab) && (input->grab_button == button) && |
627 | (!state) && (!input->grab_count)) | 628 | (!state) && (!input->grab_count)) |
628 | ecore_wl_input_ungrab(input); | 629 | ecore_wl_input_ungrab(input); |
629 | } | 630 | } |
@@ -1168,8 +1169,8 @@ _ecore_wl_input_cb_touch_up(void *data, struct wl_touch *touch EINA_UNUSED, unsi | |||
1168 | input->display->serial = serial; | 1169 | input->display->serial = serial; |
1169 | 1170 | ||
1170 | _ecore_wl_input_mouse_up_send(input, input->touch_focus, id, BTN_LEFT, timestamp); | 1171 | _ecore_wl_input_mouse_up_send(input, input->touch_focus, id, BTN_LEFT, timestamp); |
1171 | input->grab_count--; | 1172 | if (input->grab_count) input->grab_count--; |
1172 | if ((input->grab) && (input->grab_button == BTN_LEFT) && | 1173 | if ((input->grab) && (input->grab_button == BTN_LEFT) && |
1173 | (!input->grab_count)) | 1174 | (!input->grab_count)) |
1174 | ecore_wl_input_ungrab(input); | 1175 | ecore_wl_input_ungrab(input); |
1175 | } | 1176 | } |