[Xfce4-commits] [xfce/libxfce4ui] 03/08: Replace gdk_error_trap_* and gdk_flush (Bug #15781)

noreply at xfce.org noreply at xfce.org
Sun Oct 13 20:20:16 CEST 2019


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

a   n   d   r   e       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       x   f   c   e   -   4   .   1   4   
   in repository xfce/libxfce4ui.

commit 92f6ceca3a95568f7d4c7c6dc442b324e9a75c7b
Author: Andre Miranda <andreldm at xfce.org>
Date:   Sun Aug 4 13:37:15 2019 -0300

    Replace gdk_error_trap_* and gdk_flush (Bug #15781)
---
 libxfce4kbd-private/xfce-shortcuts-grabber.c | 22 +++++++++++++++++-----
 libxfce4ui/xfce-spawn.c                      |  8 +++++++-
 2 files changed, 24 insertions(+), 6 deletions(-)

diff --git a/libxfce4kbd-private/xfce-shortcuts-grabber.c b/libxfce4kbd-private/xfce-shortcuts-grabber.c
index 361535b..ce1f3a5 100644
--- a/libxfce4kbd-private/xfce-shortcuts-grabber.c
+++ b/libxfce4kbd-private/xfce-shortcuts-grabber.c
@@ -320,12 +320,12 @@ xfce_shortcuts_grabber_grab (XfceShortcutsGrabber *grabber,
 #if GTK_CHECK_VERSION (3, 0, 0)
           /* Retrieve the root window of the screen */
           root_window = GDK_WINDOW_XID (gdk_screen_get_root_window (gdk_display_get_screen (display, j)));
+          gdk_x11_display_error_trap_push (display);
 #else
           /* Retrieve the root window of the screen */
           root_window = GDK_WINDOW_XWINDOW (gdk_screen_get_root_window (gdk_display_get_screen (display, j)));
-#endif
-
           gdk_error_trap_push ();
+#endif
 
           for (k = 0; k < G_N_ELEMENTS (mod_masks); k++)
             {
@@ -345,9 +345,15 @@ xfce_shortcuts_grabber_grab (XfceShortcutsGrabber *grabber,
                             root_window);
             }
 
+#if GTK_CHECK_VERSION (3, 0, 0)
+          gdk_display_flush (display);
+
+          if (gdk_x11_display_error_trap_pop (display))
+#else
           gdk_flush ();
 
           if (gdk_error_trap_pop ())
+#endif
             {
               if (grab)
                 TRACE ("Failed to grab");
@@ -404,6 +410,7 @@ xfce_shortcuts_grabber_event_filter (GdkXEvent            *gdk_xevent,
   struct EventKeyFindContext  context;
   GdkKeymap                  *keymap;
   GdkModifierType             consumed, modifiers;
+  GdkDisplay                 *display;
   XEvent                     *xevent;
   guint                       keyval, mod_mask;
   gchar                      *raw_shortcut_name;
@@ -421,7 +428,12 @@ xfce_shortcuts_grabber_event_filter (GdkXEvent            *gdk_xevent,
   timestamp = xevent->xkey.time;
 
   /* Get the keyboard state */
+  display = gdk_display_get_default ();
+#if GTK_CHECK_VERSION (3, 0, 0)
+  gdk_x11_display_error_trap_push (display);
+#else
   gdk_error_trap_push ();
+#endif
   keymap = gdk_keymap_get_default ();
   mod_mask = gtk_accelerator_get_default_mod_mask ();
   modifiers = xevent->xkey.state;
@@ -483,11 +495,11 @@ xfce_shortcuts_grabber_event_filter (GdkXEvent            *gdk_xevent,
     g_signal_emit_by_name (grabber, "shortcut-activated",
                            context.result, timestamp);
 
-  gdk_flush ();
-
 #if GTK_CHECK_VERSION (3, 0, 0)
-  gdk_error_trap_pop_ignored ();
+  gdk_display_flush (display);
+  gdk_x11_display_error_trap_pop_ignored (display);
 #else
+  gdk_flush ();
   gdk_error_trap_pop ();
 #endif
 
diff --git a/libxfce4ui/xfce-spawn.c b/libxfce4ui/xfce-spawn.c
index 77f55e9..03bc69c 100644
--- a/libxfce4ui/xfce-spawn.c
+++ b/libxfce4ui/xfce-spawn.c
@@ -214,7 +214,13 @@ xfce_spawn_get_active_workspace_number (GdkScreen *screen)
   gint       format_ret;
   gint       ws_num = 0;
 
+#if GTK_CHECK_VERSION (3, 0, 0)
+  GdkDisplay *display;
+  display = gdk_screen_get_display (screen);
+  gdk_x11_display_error_trap_push (display);
+#else
   gdk_error_trap_push ();
+#endif
 
   root = gdk_screen_get_root_window (screen);
 
@@ -250,7 +256,7 @@ xfce_spawn_get_active_workspace_number (GdkScreen *screen)
     }
 
 #if GTK_CHECK_VERSION (3, 0, 0)
-  gdk_error_trap_pop_ignored ();
+  gdk_x11_display_error_trap_pop_ignored (display);
 #else
   if (gdk_error_trap_pop () != 0)
     return 0;

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


More information about the Xfce4-commits mailing list