[gtk+] wayland: Perform seat grab focus checks on native windows



commit 14967d8d7dbc36d535911425fab1fee19fb9d361
Author: Carlos Garnacho <carlosg gnome org>
Date:   Wed Apr 27 12:12:18 2016 +0200

    wayland: Perform seat grab focus checks on native windows
    
    We don't care about the specific (possibly client-side) window that
    requested the focus here, only the toplevel. Fixes mistakenly sent
    focus events when the grab happens inside the current focus window.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=762756

 gdk/wayland/gdkdevice-wayland.c |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)
---
diff --git a/gdk/wayland/gdkdevice-wayland.c b/gdk/wayland/gdkdevice-wayland.c
index e3f7fac..8d0a61e 100644
--- a/gdk/wayland/gdkdevice-wayland.c
+++ b/gdk/wayland/gdkdevice-wayland.c
@@ -3722,7 +3722,7 @@ gdk_wayland_seat_grab (GdkSeat                *seat,
   if (native == NULL || GDK_WINDOW_DESTROYED (native))
     return GDK_GRAB_NOT_VIEWABLE;
 
-  gdk_wayland_seat_set_grab_window (wayland_seat, window);
+  gdk_wayland_seat_set_grab_window (wayland_seat, native);
   wayland_seat->grab_time = evtime;
 
   if (prepare_func)
@@ -3741,9 +3741,9 @@ gdk_wayland_seat_grab (GdkSeat                *seat,
     {
       GdkWindow *prev_focus = gdk_wayland_device_get_focus (wayland_seat->master_pointer);
 
-      if (prev_focus != window)
+      if (prev_focus != native)
         device_emit_grab_crossing (wayland_seat->master_pointer, prev_focus,
-                                   window, GDK_CROSSING_GRAB, evtime);
+                                   native, GDK_CROSSING_GRAB, evtime);
 
       _gdk_display_add_device_grab (display,
                                     wayland_seat->master_pointer,
@@ -3766,9 +3766,9 @@ gdk_wayland_seat_grab (GdkSeat                *seat,
     {
       GdkWindow *prev_focus = gdk_wayland_device_get_focus (wayland_seat->touch_master);
 
-      if (prev_focus != window)
+      if (prev_focus != native)
         device_emit_grab_crossing (wayland_seat->touch_master, prev_focus,
-                                   window, GDK_CROSSING_GRAB, evtime);
+                                   native, GDK_CROSSING_GRAB, evtime);
 
       _gdk_display_add_device_grab (display,
                                     wayland_seat->touch_master,
@@ -3787,9 +3787,9 @@ gdk_wayland_seat_grab (GdkSeat                *seat,
     {
       GdkWindow *prev_focus = gdk_wayland_device_get_focus (wayland_seat->master_keyboard);
 
-      if (prev_focus != window)
+      if (prev_focus != native)
         device_emit_grab_crossing (wayland_seat->master_keyboard, prev_focus,
-                                   window, GDK_CROSSING_GRAB, evtime);
+                                   native, GDK_CROSSING_GRAB, evtime);
 
       _gdk_display_add_device_grab (display,
                                     wayland_seat->master_keyboard,
@@ -3811,9 +3811,9 @@ gdk_wayland_seat_grab (GdkSeat                *seat,
           GdkWaylandTabletData *tablet = l->data;
           GdkWindow *prev_focus = gdk_wayland_device_get_focus (tablet->master);
 
-          if (prev_focus != window)
+          if (prev_focus != native)
             device_emit_grab_crossing (tablet->master, prev_focus,
-                                       window, GDK_CROSSING_GRAB, evtime);
+                                       native, GDK_CROSSING_GRAB, evtime);
 
           _gdk_display_add_device_grab (display,
                                         tablet->master,


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