[gtk/gtk-3-24: 1/2] Revert "gdk: deactivate/activate surface on keyboard grabs"



commit e84016cd173900bb3d79affd6c61733e6dad26c0
Author: Samuel Thibault <samuel thibault ens-lyon org>
Date:   Fri Jan 4 16:55:17 2019 +0100

    Revert "gdk: deactivate/activate surface on keyboard grabs"
    
    This reverts commits f23bfc6b6966b910aa43a441141ec2b9fec14427. and
    c926b28d965dbae90b17d404d2c6d1e031a6f006.
    
    This reintroduces #85, but see discussion in
    https://gitlab.gnome.org/GNOME/gtk/merge_requests/433 for the unforeseen
    invasive consequences of these commits.

 gdk/x11/gdkdevicemanager-core-x11.c | 8 ++++----
 gdk/x11/gdkeventsource.c            | 8 ++++----
 2 files changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/gdk/x11/gdkdevicemanager-core-x11.c b/gdk/x11/gdkdevicemanager-core-x11.c
index 806225e826..350a79b03f 100644
--- a/gdk/x11/gdkdevicemanager-core-x11.c
+++ b/gdk/x11/gdkdevicemanager-core-x11.c
@@ -29,8 +29,8 @@
 #include "gdkkeysyms.h"
 
 
-#define APPEARS_FOCUSED(toplevel)                           \
-  ((toplevel)->has_focus || (toplevel)->has_focus_window || (toplevel)->has_pointer_focus)
+#define HAS_FOCUS(toplevel)                           \
+  ((toplevel)->has_focus || (toplevel)->has_pointer_focus)
 
 static void    gdk_x11_device_manager_core_finalize    (GObject *object);
 static void    gdk_x11_device_manager_core_constructed (GObject *object);
@@ -842,7 +842,7 @@ _gdk_device_manager_core_handle_focus (GdkWindow *window,
   if (toplevel->focus_window == original)
     return;
 
-  had_focus = APPEARS_FOCUSED (toplevel);
+  had_focus = HAS_FOCUS (toplevel);
   x11_screen = GDK_X11_SCREEN (gdk_window_get_screen (window));
 
   switch (detail)
@@ -904,7 +904,7 @@ _gdk_device_manager_core_handle_focus (GdkWindow *window,
       break;
     }
 
-  if (APPEARS_FOCUSED (toplevel) != had_focus)
+  if (HAS_FOCUS (toplevel) != had_focus)
     {
       GdkEvent *event;
 
diff --git a/gdk/x11/gdkeventsource.c b/gdk/x11/gdkeventsource.c
index e0ce59663c..774d10c528 100644
--- a/gdk/x11/gdkeventsource.c
+++ b/gdk/x11/gdkeventsource.c
@@ -32,8 +32,8 @@ static gboolean gdk_event_source_dispatch (GSource     *source,
                                            gpointer     user_data);
 static void     gdk_event_source_finalize (GSource     *source);
 
-#define APPEARS_FOCUSED(toplevel)                           \
-  ((toplevel)->has_focus || (toplevel)->has_focus_window || (toplevel)->has_pointer_focus)
+#define HAS_FOCUS(toplevel)                           \
+  ((toplevel)->has_focus || (toplevel)->has_pointer_focus)
 
 struct _GdkEventSource
 {
@@ -148,10 +148,10 @@ handle_focus_change (GdkEventCrossing *event)
   if (!event->focus || toplevel->has_focus_window)
     return;
 
-  had_focus = APPEARS_FOCUSED (toplevel);
+  had_focus = HAS_FOCUS (toplevel);
   toplevel->has_pointer_focus = focus_in;
 
-  if (APPEARS_FOCUSED (toplevel) != had_focus)
+  if (HAS_FOCUS (toplevel) != had_focus)
     {
       GdkEvent *focus_event;
 


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