devilhorns pushed a commit to branch master.
commit 9325324c031488107cf480d192d0b3e9ce11d701
Author: Chris Michael <[email protected]>
Date: Fri Aug 16 09:49:52 2013 +0100
Increment/Decrement button count in the button handlers, not in the
border hooks.
Signed-off-by: Chris Michael <[email protected]>
---
src/modules/wl_desktop_shell/e_mod_main.c | 26 ++++++++++++++++----------
1 file changed, 16 insertions(+), 10 deletions(-)
diff --git a/src/modules/wl_desktop_shell/e_mod_main.c
b/src/modules/wl_desktop_shell/e_mod_main.c
index 4406aa7..161dbc1 100644
--- a/src/modules/wl_desktop_shell/e_mod_main.c
+++ b/src/modules/wl_desktop_shell/e_mod_main.c
@@ -1526,16 +1526,11 @@ _e_wl_shell_shell_surface_cb_bd_move_end(void *data,
void *bd)
/* is the shell surface the same one in the grab ? */
if ((ptr->current) && (ptr->current != ews->wl.surface)) return;
- ptr->button_count--;
-
/* send this button press to the pointer */
ptr->grab->interface->button(ptr->grab,
ptr->grab_time,
ptr->grab_button,
WL_POINTER_BUTTON_STATE_RELEASED);
-
- if (ptr->button_count == 1)
- ptr->grab_serial = wl_display_get_serial(_e_wl_comp->wl.display);
}
}
@@ -1608,16 +1603,11 @@ _e_wl_shell_shell_surface_cb_bd_resize_end(void *data,
void *bd)
/* is the shell surface the same one in the grab ? */
if ((ptr->current) && (ptr->current != ews->wl.surface)) return;
- ptr->button_count--;
-
/* send this button press to the pointer */
ptr->grab->interface->button(ptr->grab,
ptr->grab_time,
ptr->grab_button,
WL_POINTER_BUTTON_STATE_RELEASED);
-
- if (ptr->button_count == 1)
- ptr->grab_serial = wl_display_get_serial(_e_wl_comp->wl.display);
}
}
@@ -2092,6 +2082,14 @@ _e_wl_shell_move_grab_cb_button(struct wl_pointer_grab
*grab, unsigned int times
/* try to get the pointer */
if (!(ptr = grab->pointer)) return;
+ if (state == WL_POINTER_BUTTON_STATE_RELEASED)
+ ptr->button_count--;
+ else
+ ptr->button_count++;
+
+ if (ptr->button_count == 1)
+ ptr->grab_serial = wl_display_get_serial(_e_wl_comp->wl.display);
+
/* test if we are done with the grab */
if ((ptr->button_count == 0) &&
(state == WL_POINTER_BUTTON_STATE_RELEASED))
@@ -2168,6 +2166,14 @@ _e_wl_shell_resize_grab_cb_button(struct wl_pointer_grab
*grab, unsigned int tim
/* try to get the pointer */
if (!(ptr = grab->pointer)) return;
+ if (state == WL_POINTER_BUTTON_STATE_RELEASED)
+ ptr->button_count--;
+ else
+ ptr->button_count++;
+
+ if (ptr->button_count == 1)
+ ptr->grab_serial = wl_display_get_serial(_e_wl_comp->wl.display);
+
/* test if we are done with the grab */
if ((ptr->button_count == 0) &&
(state == WL_POINTER_BUTTON_STATE_RELEASED))
--
------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead.
Download for free and get started troubleshooting in minutes.
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk