Skip to content

Commit 5e16dc1

Browse files
author
raveit65
committed
mate-bg: replace deprecated gdk_error_trap_push/pop
1 parent d21326d commit 5e16dc1

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

libmate-desktop/mate-bg.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1444,6 +1444,7 @@ mate_bg_get_surface_from_root (GdkScreen *screen)
14441444
int screen_num;
14451445
cairo_surface_t *surface;
14461446
cairo_surface_t *source_pixmap;
1447+
GdkDisplay *gdkdisplay;
14471448
int width, height;
14481449
cairo_t *cr;
14491450

@@ -1466,7 +1467,8 @@ mate_bg_get_surface_from_root (GdkScreen *screen)
14661467
}
14671468

14681469
if (data != NULL) {
1469-
gdk_error_trap_push ();
1470+
gdkdisplay = gdk_screen_get_display (screen);
1471+
gdk_x11_display_error_trap_push (gdkdisplay);
14701472

14711473
Pixmap xpixmap = *(Pixmap *) data;
14721474
Window root_return;
@@ -1484,7 +1486,7 @@ mate_bg_get_surface_from_root (GdkScreen *screen)
14841486
w_ret, h_ret);
14851487
}
14861488

1487-
gdk_error_trap_pop_ignored ();
1489+
gdk_x11_display_error_trap_pop_ignored (gdkdisplay);
14881490
}
14891491

14901492
width = WidthOfScreen (gdk_x11_screen_get_xscreen (screen));
@@ -1537,6 +1539,7 @@ mate_bg_set_root_pixmap_id (GdkScreen *screen,
15371539
int format, result;
15381540
unsigned long nitems, after;
15391541
unsigned char *data_root, *data_esetroot;
1542+
GdkDisplay *gdkdisplay;
15401543

15411544
/* Get atoms for both properties in an array, only if they exist.
15421545
* This method is to avoid multiple round-trips to Xserver
@@ -1561,14 +1564,15 @@ mate_bg_set_root_pixmap_id (GdkScreen *screen,
15611564
Pixmap xrootpmap = *((Pixmap *) data_root);
15621565
Pixmap esetrootpmap = *((Pixmap *) data_esetroot);
15631566

1564-
gdk_error_trap_push ();
1567+
gdkdisplay = gdk_screen_get_display (screen);
1568+
gdk_x11_display_error_trap_push (gdkdisplay);
15651569
if (xrootpmap && xrootpmap == esetrootpmap) {
15661570
XKillClient (display, xrootpmap);
15671571
}
15681572
if (esetrootpmap && esetrootpmap != xrootpmap) {
15691573
XKillClient (display, esetrootpmap);
15701574
}
1571-
gdk_error_trap_pop_ignored ();
1575+
gdk_x11_display_error_trap_pop_ignored (gdkdisplay);
15721576
}
15731577
if (data_esetroot != NULL) {
15741578
XFree (data_esetroot);

0 commit comments

Comments
 (0)