[PATCH weston 2/2] Fix popup menu button input.

Scott Moreau oreaus at gmail.com
Sun Oct 7 03:28:56 PDT 2012


Clicking on a menu item within 500ms of opening it would fail. This fixes that
problem as well as right-button-up-to-select.
---
 clients/window.c | 3 +--
 src/shell.c      | 3 ++-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/clients/window.c b/clients/window.c
index 9a75a46..51a9c69 100644
--- a/clients/window.c
+++ b/clients/window.c
@@ -3293,8 +3293,7 @@ menu_button_handler(struct widget *widget,
 {
 	struct menu *menu = data;
 
-	if (state == WL_POINTER_BUTTON_STATE_PRESSED &&
-	    time - menu->time > 500) {
+	if (state == WL_POINTER_BUTTON_STATE_PRESSED) {
 		/* Either relase after press-drag-release or
 		 * click-motion-click. */
 		menu->func(menu->window->parent, 
diff --git a/src/shell.c b/src/shell.c
index e6c8ee9..93bcfaf 100644
--- a/src/shell.c
+++ b/src/shell.c
@@ -1829,7 +1829,8 @@ popup_grab_button(struct wl_pointer_grab *grab,
 		display = wl_client_get_display(resource->client);
 		serial = wl_display_get_serial(display);
 		wl_pointer_send_button(resource, serial, time, button, state);
-	} else if (state == WL_POINTER_BUTTON_STATE_RELEASED &&
+	}
+	if (state == WL_POINTER_BUTTON_STATE_RELEASED &&
 		   (shsurf->popup.initial_up ||
 		    time - shsurf->popup.seat->pointer->grab_time > 500)) {
 		wl_shell_surface_send_popup_done(&shsurf->resource);
-- 
1.7.11.4



More information about the wayland-devel mailing list