Skip to content
Permalink
Browse files

replace deprecated gdk_error_trap functions

  • Loading branch information...
yetist authored and raveit65 committed Jun 29, 2018
1 parent a4540f2 commit 8f35c049172ab4bb1f73069e6a98f29ab45c4c0b
Showing with 16 additions and 11 deletions.
  1. +4 −4 mate-session/gsm-inhibit-dialog.c
  2. +12 −7 mate-session/msm-gnome.c
@@ -423,10 +423,10 @@ get_pixbuf_for_window (GdkDisplay *gdkdisplay,
pixbuf = pixbuf_get_from_pixmap (display, xpixmap, width, height);

if (xpixmap != None) {
gdk_error_trap_push ();
gdk_x11_display_error_trap_push (gdkdisplay);
XFreePixmap (display, xpixmap);
gdk_display_sync (gdkdisplay);
gdk_error_trap_pop_ignored ();
gdk_x11_display_error_trap_pop_ignored (gdkdisplay);
}

if (pixbuf != NULL) {
@@ -958,7 +958,7 @@ gsm_inhibit_dialog_constructor (GType type,

#ifdef HAVE_XRENDER
gdkdisplay = gdk_display_get_default ();
gdk_error_trap_push ();
gdk_x11_display_error_trap_push (gdkdisplay);
if (XRenderQueryExtension (GDK_DISPLAY_XDISPLAY (gdkdisplay), &dialog->priv->xrender_event_base, &dialog->priv->xrender_error_base)) {
g_debug ("GsmInhibitDialog: Initialized XRender extension");
dialog->priv->have_xrender = TRUE;
@@ -967,7 +967,7 @@ gsm_inhibit_dialog_constructor (GType type,
dialog->priv->have_xrender = FALSE;
}
gdk_display_sync (gdkdisplay);
gdk_error_trap_pop_ignored ();
gdk_x11_display_error_trap_pop_ignored (gdkdisplay);
#endif /* HAVE_XRENDER */

/* FIXME: turn this on when it is ready */
@@ -171,15 +171,17 @@ msm_compat_gnome_smproxy_startup (void)
Atom gnome_sm_proxy;
Display *dpy;
Window root;
GdkDisplay *gdkdisplay;

gdk_error_trap_push ();
gdkdisplay = gdk_display_get_default ();
gdk_x11_display_error_trap_push (gdkdisplay);

/* Set GNOME_SM_PROXY property, since some apps (like OOo) seem to require
* it to behave properly. Thanks to Jasper/Francois for reporting this.
* This has another advantage, since it prevents people from running
* gnome-smproxy in xfce4, which would cause trouble otherwise.
*/
dpy = GDK_DISPLAY_XDISPLAY(gdk_display_get_default());
dpy = GDK_DISPLAY_XDISPLAY(gdkdisplay);
root = RootWindow (dpy, 0);

if (gnome_smproxy_window != None)
@@ -196,22 +198,25 @@ msm_compat_gnome_smproxy_startup (void)
(unsigned char *) (void *) &gnome_smproxy_window, 1);

XSync (dpy, False);
gdk_error_trap_pop_ignored ();
gdk_x11_display_error_trap_pop_ignored (gdkdisplay);
}


static void
msm_compat_gnome_smproxy_shutdown (void)
{
gdk_error_trap_push ();
GdkDisplay *gdkdisplay;

gdkdisplay = gdk_display_get_default ();
gdk_x11_display_error_trap_push (gdkdisplay);

if (gnome_smproxy_window != None)
{
XDestroyWindow (GDK_DISPLAY_XDISPLAY(gdk_display_get_default()), gnome_smproxy_window);
XSync (GDK_DISPLAY_XDISPLAY(gdk_display_get_default()), False);
XDestroyWindow (GDK_DISPLAY_XDISPLAY(gdkdisplay), gnome_smproxy_window);
XSync (GDK_DISPLAY_XDISPLAY(gdkdisplay), False);
gnome_smproxy_window = None;
}
gdk_error_trap_pop_ignored ();
gdk_x11_display_error_trap_pop_ignored (gdkdisplay);
}


0 comments on commit 8f35c04

Please sign in to comment.
You can’t perform that action at this time.