[gtk+] gdkwindow-x11: Don't set WM_TAKE_FOCUS if accept_focus is FALSE



commit 809aab2c8ec88c7b10254a948ba8754a766b1f7c
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Wed Oct 16 22:17:16 2013 -0400

    gdkwindow-x11: Don't set WM_TAKE_FOCUS if accept_focus is FALSE
    
    Otherwise, we'll be in the "Globally Active" mode instead of the
    "No Input" mode.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=710389

 gdk/x11/gdkwindow-x11.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/gdk/x11/gdkwindow-x11.c b/gdk/x11/gdkwindow-x11.c
index fd6fbdf..6ee7a96 100644
--- a/gdk/x11/gdkwindow-x11.c
+++ b/gdk/x11/gdkwindow-x11.c
@@ -772,9 +772,11 @@ set_wm_protocols (GdkWindow *window)
   int n = 0;
   
   protocols[n++] = gdk_x11_get_xatom_by_name_for_display (display, "WM_DELETE_WINDOW");
-  protocols[n++] = gdk_x11_get_xatom_by_name_for_display (display, "WM_TAKE_FOCUS");
   protocols[n++] = gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_PING");
 
+  if (window->accept_focus)
+    protocols[n++] = gdk_x11_get_xatom_by_name_for_display (display, "WM_TAKE_FOCUS");
+
 #ifdef HAVE_XSYNC
   if (GDK_X11_DISPLAY (display)->use_sync)
     protocols[n++] = gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_SYNC_REQUEST");
@@ -3489,7 +3491,10 @@ gdk_x11_window_set_accept_focus (GdkWindow *window,
 
       if (!GDK_WINDOW_DESTROYED (window) &&
          WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
-       update_wm_hints (window, FALSE);
+        {
+          update_wm_hints (window, FALSE);
+          set_wm_protocols (window);
+        }
     }
 }
 


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