summaryrefslogtreecommitdiff
path: root/0001-x11-Avoid-setting-has_pointer_focus-if-a-EWMH-compli.patch
blob: ac7a7e245dd986a8beb183f0674071b6a6f0f69c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
From 5b395e7bb44651f57246e9dcc78d6e1bd373f6a6 Mon Sep 17 00:00:00 2001
From: Carlos Garnacho <carlosg@gnome.org>
Date: Fri, 13 Jun 2014 14:38:03 +0200
Subject: [PATCH] x11: Avoid setting has_pointer_focus if a EWMH compliant WM
 is present

This is mostly useful to have focus behave sanely on lack of WM, so avoid
any check there if we're positive there is a WM handling focus.

https://bugzilla.gnome.org/show_bug.cgi?id=677329
---
 gdk/x11/gdkdevicemanager-core-x11.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/gdk/x11/gdkdevicemanager-core-x11.c b/gdk/x11/gdkdevicemanager-core-x11.c
index 8d6848869e0d..c4aac3f4dee9 100644
--- a/gdk/x11/gdkdevicemanager-core-x11.c
+++ b/gdk/x11/gdkdevicemanager-core-x11.c
@@ -820,6 +820,7 @@ _gdk_device_manager_core_handle_focus (GdkWindow *window,
                                        int        mode)
 {
   GdkToplevelX11 *toplevel;
+  GdkX11Screen *x11_screen;
   gboolean had_focus;
 
   g_return_if_fail (GDK_IS_WINDOW (window));
@@ -880,11 +881,14 @@ _gdk_device_manager_core_handle_focus (GdkWindow *window,
         toplevel->has_focus = (focus_in) ? TRUE : FALSE;
       break;
     case NotifyPointer:
+      x11_screen = GDK_X11_SCREEN (gdk_window_get_screen (window));
+
       /* The X server sends NotifyPointer/NotifyGrab,
        * but the pointer focus is ignored while a
        * grab is in effect
        */
-      if (mode != NotifyGrab &&
+      if (!x11_screen->wmspec_check_window &&
+          mode != NotifyGrab &&
 #ifdef XINPUT_2
 	  mode != XINotifyPassiveGrab &&
 	  mode != XINotifyPassiveUngrab &&
-- 
2.5.0

bgstack15