[libwnck] xutils: avoid deprecated functions



commit 2661a3a0467ebdf173e54aea1f465c405b35472e
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Tue Jan 9 17:31:10 2018 +0200

    xutils: avoid deprecated functions
    
    https://git.gnome.org/browse/gtk+/commit/?id=176c1046cb1388f70ea257ac15b7ac537d219545

 libwnck/xutils.c |   24 +++++++++++++++++++-----
 1 files changed, 19 insertions(+), 5 deletions(-)
---
diff --git a/libwnck/xutils.c b/libwnck/xutils.c
index d20f11e..58bbe97 100644
--- a/libwnck/xutils.c
+++ b/libwnck/xutils.c
@@ -699,14 +699,24 @@ _wnck_set_utf8_list (Screen  *screen,
 void
 _wnck_error_trap_push (Display *display)
 {
-  gdk_error_trap_push ();
+  GdkDisplay *gdk_display;
+
+  gdk_display = gdk_x11_lookup_xdisplay (display);
+  g_assert (gdk_display != NULL);
+
+  gdk_x11_display_error_trap_push (gdk_display);
 }
 
 int
 _wnck_error_trap_pop (Display *display)
 {
-  gdk_flush ();
-  return gdk_error_trap_pop ();
+  GdkDisplay *gdk_display;
+
+  gdk_display = gdk_x11_lookup_xdisplay (display);
+  g_assert (gdk_display != NULL);
+
+  gdk_display_flush (gdk_display);
+  return gdk_x11_display_error_trap_pop (gdk_display);
 }
 
 static GdkFilterReturn
@@ -1781,6 +1791,7 @@ try_pixmap_and_mask (Screen     *screen,
                      int         ideal_mini_height)
 {
   cairo_surface_t *surface, *mask_surface, *image;
+  GdkDisplay *gdk_display;
   GdkPixbuf *unscaled;
   int width, height;
   cairo_t *cr;
@@ -1798,7 +1809,10 @@ try_pixmap_and_mask (Screen     *screen,
   if (surface == NULL)
     return FALSE;
 
-  gdk_error_trap_push ();
+  gdk_display = gdk_x11_lookup_xdisplay (XDisplayOfScreen (screen));
+  g_assert (gdk_display != NULL);
+
+  gdk_x11_display_error_trap_push (gdk_display);
 
   width = cairo_xlib_surface_get_width (surface);
   height = cairo_xlib_surface_get_height (surface);
@@ -1838,7 +1852,7 @@ try_pixmap_and_mask (Screen     *screen,
   cairo_surface_destroy (surface);
   cairo_destroy (cr);
 
-  if (gdk_error_trap_pop () != Success)
+  if (gdk_x11_display_error_trap_pop (gdk_display) != Success)
     {
       cairo_surface_destroy (image);
       return FALSE;


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