Skip to content

Commit

Permalink
fm-desktop-icon-view: replace deprecated gdk_error_trap_push/pop func…
Browse files Browse the repository at this point in the history
…tions
  • Loading branch information
raveit65 authored and lukefromdc committed May 7, 2018
1 parent 2392093 commit fc70465
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/file-manager/fm-desktop-icon-view.c
Expand Up @@ -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;
Expand All @@ -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),
Expand All @@ -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)
Expand All @@ -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),
Expand All @@ -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
Expand Down

0 comments on commit fc70465

Please sign in to comment.