[Xfce4-commits] [xfce/xfce4-settings] 03/05: xsettings: Grab and sync XServer on startup (Bug #15725)

noreply at xfce.org noreply at xfce.org
Fri Jul 26 00:15:53 CEST 2019


This is an automated email from the git hooks/post-receive script.

o   c   h   o   s   i       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository xfce/xfce4-settings.

commit 523abc95d66cf7aa76f76ba0a6f0363b2dd4c51c
Author: Olivier Fourdan <fourdan at xfce.org>
Date:   Fri Jul 19 14:10:08 2019 +0200

    xsettings: Grab and sync XServer on startup (Bug #15725)
    
    Grab the XServer when declaring ourselves the xsettings manager and flush
    it prior to ungrabbing it to make sure everything gets set for other clients.
    
    The goal is to avoid other X11 clients from reading xsettings until we
    are done initializing.
    
    Signed-off-by: Olivier Fourdan <fourdan at xfce.org>
---
 xfsettingsd/xsettings.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/xfsettingsd/xsettings.c b/xfsettingsd/xsettings.c
index eb3cc6d..681b83e 100644
--- a/xfsettingsd/xsettings.c
+++ b/xfsettingsd/xsettings.c
@@ -1086,7 +1086,8 @@ xfce_xsettings_helper_register (XfceXSettingsHelper *helper,
     xdisplay = GDK_DISPLAY_XDISPLAY (gdkdisplay);
     helper->xsettings_atom = XInternAtom (xdisplay, "_XSETTINGS_SETTINGS", False);
 
-    gdk_x11_display_error_trap_push (gdk_display_get_default ());
+    gdk_x11_display_grab (gdkdisplay);
+    gdk_x11_display_error_trap_push (gdkdisplay);
 
     /* Previously, gdk_display_get_n_screens. Since Gtk 3.10, the number of screens is always 1. */
     n_screens = 1;
@@ -1166,7 +1167,9 @@ xfce_xsettings_helper_register (XfceXSettingsHelper *helper,
         }
     }
 
-    if (gdk_x11_display_error_trap_pop (gdk_display_get_default ()) != 0)
+    gdk_display_sync (gdkdisplay);
+    gdk_x11_display_ungrab (gdkdisplay);
+    if (gdk_x11_display_error_trap_pop (gdkdisplay) != 0)
         g_critical ("Failed to initialize screens");
 
     if (helper->screens != NULL)

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list