029087d
From 18406b7b04da088f8a3efe7cca5ac1647080dc0b Mon Sep 17 00:00:00 2001
029087d
From: Matthias Clasen <mclasen@redhat.com>
029087d
Date: Thu, 22 Dec 2011 15:44:28 +0000
029087d
Subject: [PATCH] Revert "x11: Avoid spurious focus events on grabs"
029087d
029087d
This reverts commit db4a6040afd3d1cabbb306037e811f37d62e2e76.
029087d
029087d
This is causing bad focus confusion e.g. in gnome-terminal.
029087d
---
029087d
 gdk/x11/gdkdevicemanager-core-x11.c    |    5 -----
029087d
 gdk/x11/gdkdevicemanager-xi2.c         |    1 -
029087d
 gdk/x11/gdkdevicemanagerprivate-core.h |    3 ---
029087d
 3 files changed, 0 insertions(+), 9 deletions(-)
029087d
029087d
diff --git a/gdk/x11/gdkdevicemanager-core-x11.c b/gdk/x11/gdkdevicemanager-core-x11.c
029087d
index 503ad54..156ba8b 100644
029087d
--- a/gdk/x11/gdkdevicemanager-core-x11.c
029087d
+++ b/gdk/x11/gdkdevicemanager-core-x11.c
029087d
@@ -665,7 +665,6 @@ gdk_x11_device_manager_core_translate_event (GdkEventTranslator *translator,
029087d
     case FocusIn:
029087d
     case FocusOut:
029087d
       _gdk_device_manager_core_handle_focus (window,
029087d
-                                             xevent->xfocus.window,
029087d
                                              device_manager->core_keyboard,
029087d
                                              NULL,
029087d
                                              xevent->type == FocusIn,
029087d
@@ -796,7 +795,6 @@ _gdk_x11_event_translate_keyboard_string (GdkEventKey *event)
029087d
  */
029087d
 void
029087d
 _gdk_device_manager_core_handle_focus (GdkWindow *window,
029087d
-                                       Window     original,
029087d
                                        GdkDevice *device,
029087d
                                        GdkDevice *source_device,
029087d
                                        gboolean   focus_in,
029087d
@@ -821,9 +819,6 @@ _gdk_device_manager_core_handle_focus (GdkWindow *window,
029087d
   if (!toplevel)
029087d
     return;
029087d
 
029087d
-  if (toplevel->focus_window == original)
029087d
-    return;
029087d
-
029087d
   had_focus = HAS_FOCUS (toplevel);
029087d
 
029087d
   switch (detail)
029087d
diff --git a/gdk/x11/gdkdevicemanager-xi2.c b/gdk/x11/gdkdevicemanager-xi2.c
029087d
index f9e4d11..273ca7d 100644
029087d
--- a/gdk/x11/gdkdevicemanager-xi2.c
029087d
+++ b/gdk/x11/gdkdevicemanager-xi2.c
029087d
@@ -1228,7 +1228,6 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
029087d
                                              GUINT_TO_POINTER (xev->sourceid));
029087d
 
029087d
         _gdk_device_manager_core_handle_focus (window,
029087d
-                                               xev->event,
029087d
                                                device,
029087d
                                                source_device,
029087d
                                                (ev->evtype == XI_FocusIn) ? TRUE : FALSE,
029087d
diff --git a/gdk/x11/gdkdevicemanagerprivate-core.h b/gdk/x11/gdkdevicemanagerprivate-core.h
029087d
index 54463bb..428b34f 100644
029087d
--- a/gdk/x11/gdkdevicemanagerprivate-core.h
029087d
+++ b/gdk/x11/gdkdevicemanagerprivate-core.h
029087d
@@ -20,8 +20,6 @@
029087d
 #ifndef __GDK_DEVICE_MANAGER_PRIVATE_CORE_H__
029087d
 #define __GDK_DEVICE_MANAGER_PRIVATE_CORE_H__
029087d
 
029087d
-#include <X11/Xlib.h>
029087d
-
029087d
 #include "gdkx11devicemanager-core.h"
029087d
 #include "gdkdevicemanagerprivate.h"
029087d
 
029087d
@@ -40,7 +38,6 @@ struct _GdkX11DeviceManagerCoreClass
029087d
 };
029087d
 
029087d
 void            _gdk_device_manager_core_handle_focus           (GdkWindow   *window,
029087d
-                                                                 Window       original,
029087d
                                                                  GdkDevice   *device,
029087d
                                                                  GdkDevice   *source_device,
029087d
                                                                  gboolean     focus_in,
029087d
-- 
029087d
1.7.8
029087d