Skip to content
Permalink
Browse files

fm-desktop-icon-view: replace deprecated gdk_error_trap_push/pop func…

…tions
  • Loading branch information...
raveit65 authored and lukefromdc committed May 5, 2018
1 parent 2392093 commit fc70465e4605d81bab8c5dfb83891efff46bf1f2
Showing with 6 additions and 4 deletions.
  1. +6 −4 src/file-manager/fm-desktop-icon-view.c
@@ -149,6 +149,7 @@ static void
net_workarea_changed (FMDesktopIconView *icon_view,
GdkWindow *window)
{
GdkDisplay *display;
long *nworkareas = NULL;
long *workareas = NULL;
GdkAtom type_returned;
@@ -165,7 +166,8 @@ net_workarea_changed (FMDesktopIconView *icon_view,
* workareas array is going to be (each desktop will have four
* elements in the workareas array describing
* x,y,width,height) */
gdk_error_trap_push ();
display = gtk_widget_get_display (GTK_WIDGET (icon_view));
gdk_x11_display_error_trap_push (display);
if (!gdk_property_get (window,
gdk_atom_intern ("_NET_NUMBER_OF_DESKTOPS", FALSE),
gdk_x11_xatom_to_atom (XA_CARDINAL),
@@ -177,7 +179,7 @@ net_workarea_changed (FMDesktopIconView *icon_view,
{
g_warning("Can not calculate _NET_NUMBER_OF_DESKTOPS");
}
if (gdk_error_trap_pop()
if (gdk_x11_display_error_trap_pop (display)
|| nworkareas == NULL
|| type_returned != gdk_x11_xatom_to_atom (XA_CARDINAL)
|| format_returned != 32)
@@ -193,7 +195,7 @@ net_workarea_changed (FMDesktopIconView *icon_view,
* request does not correspond to the number of bytes you get
* back, and is the reason for the workaround below.
*/
gdk_error_trap_push ();
gdk_x11_display_error_trap_push (display);
if (nworkareas == NULL || (*nworkareas < 1)
|| !gdk_property_get (window,
gdk_atom_intern ("_NET_WORKAREA", FALSE),
@@ -208,7 +210,7 @@ net_workarea_changed (FMDesktopIconView *icon_view,
workareas = NULL;
}

if (gdk_error_trap_pop ()
if (gdk_x11_display_error_trap_pop (display)
|| workareas == NULL
|| type_returned != gdk_x11_xatom_to_atom (XA_CARDINAL)
|| ((*nworkareas) * 4 * sizeof(long)) != length_returned

0 comments on commit fc70465

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