[mutter/wip/wayland] wayland: Fix release of implicit grab for synthesized X events



commit d071db47236c72128e6459527c82f4cfd9e4174a
Author: Neil Roberts <neil linux intel com>
Date:   Tue Jan 17 18:41:05 2012 +0000

    wayland: Fix release of implicit grab for synthesized X events
    
    When synthesizing X events from Clutter events for the rest of Mutter,
    the button release event was being handled in the wrong order so it
    would go to the new window instead of the window with the grab.

 src/wayland/meta-wayland.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/src/wayland/meta-wayland.c b/src/wayland/meta-wayland.c
index 2e4fd52..166fffc 100644
--- a/src/wayland/meta-wayland.c
+++ b/src/wayland/meta-wayland.c
@@ -1062,10 +1062,6 @@ event_cb (ClutterActor *stage,
       xevent.type = ButtonRelease;
       xevent.xbutton.button = event->button.button;
       xevent.xbutton.same_screen = TRUE;
-
-      if (compositor->implicit_grab_surface &&
-          event->button.button == compositor->implicit_grab_button)
-        compositor->implicit_grab_surface = NULL;
       break;
 
     case CLUTTER_MOTION:
@@ -1123,6 +1119,11 @@ event_cb (ClutterActor *stage,
   /* The Clutter state flags exactly match the X values */
   xevent.xbutton.state = clutter_event_get_state (event);
 
+  if (event->type == CLUTTER_BUTTON_RELEASE &&
+      compositor->implicit_grab_surface &&
+      event->button.button == compositor->implicit_grab_button)
+    compositor->implicit_grab_surface = NULL;
+
   meta_display_handle_event (display, &xevent);
 
   return FALSE;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]