[mutter/wayland] wayland-seat: Fix updating the grab serial



commit ad84aef7663b982a14223e8a4d254a920ae797b9
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Tue Nov 12 15:42:31 2013 -0500

    wayland-seat: Fix updating the grab serial
    
    We shouldn't update the grab serial if we go from 2 buttons => 1.

 src/wayland/meta-wayland-seat.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/src/wayland/meta-wayland-seat.c b/src/wayland/meta-wayland-seat.c
index 17544b3..2a0b16f 100644
--- a/src/wayland/meta-wayland-seat.c
+++ b/src/wayland/meta-wayland-seat.c
@@ -280,13 +280,14 @@ handle_button_event (MetaWaylandSeat    *seat,
                      const ClutterEvent *event)
 {
   MetaWaylandPointer *pointer = &seat->pointer;
-  gboolean state = event->type == CLUTTER_BUTTON_PRESS;
+  gboolean implicit_grab;
   uint32_t button;
   MetaWaylandSurface *surface;
 
   notify_motion (seat, event);
 
-  if (state && pointer->button_count == 1)
+  implicit_grab = (event->type == CLUTTER_BUTTON_PRESS) && (pointer->button_count == 1);
+  if (implicit_grab)
     {
       button = clutter_event_get_button (event);
       pointer->grab_button = button;
@@ -307,7 +308,7 @@ handle_button_event (MetaWaylandSeat    *seat,
 
   pointer->grab->interface->button (pointer->grab, event);
 
-  if (pointer->button_count == 1)
+  if (implicit_grab)
     pointer->grab_serial = wl_display_get_serial (seat->display);
 }
 


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