Skip to content
Permalink
Browse files

stickynotes: replace deprecated gdk_error_trap_push/pop functions

and renaming gdk_display to xdisplay var to match
GDK_DISPLAY_XDISPLAY, what it really is.
  • Loading branch information...
raveit65 authored and lukefromdc committed Jul 6, 2018
1 parent 3cd2d15 commit 7551de5b32663e76df12669ef9a41a3e61160a44
Showing with 7 additions and 5 deletions.
  1. +7 −5 stickynotes/util.c
@@ -86,20 +86,22 @@ xstuff_get_current_workspace (GtkWindow *window)
int format;
int result;
int retval;
Display *gdk_display;
GdkDisplay *gdk_display;
Display *xdisplay;

root_window = GDK_WINDOW_XID (gtk_widget_get_window (GTK_WIDGET (window)));
gdk_display = GDK_DISPLAY_XDISPLAY (gdk_display_get_default ());
gdk_display = gdk_display_get_default ();
xdisplay = GDK_DISPLAY_XDISPLAY (gdk_display);

gdk_error_trap_push ();
result = XGetWindowProperty (gdk_display,
gdk_x11_display_error_trap_push (gdk_display);
result = XGetWindowProperty (xdisplay,
root_window,
xstuff_atom_get ("_NET_CURRENT_DESKTOP"),
0, G_MAXLONG,
False, XA_CARDINAL,
&type, &format, &nitems,
&bytes_after, (gpointer) &num);
if (gdk_error_trap_pop () || result != Success)
if (gdk_x11_display_error_trap_pop (gdk_display) || result != Success)
return -1;

if (type != XA_CARDINAL) {

0 comments on commit 7551de5

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