@@ -149,6 +149,7 @@ static void
149149net_workarea_changed (FMDesktopIconView * icon_view ,
150150 GdkWindow * window )
151151{
152+ GdkDisplay * display ;
152153 long * nworkareas = NULL ;
153154 long * workareas = NULL ;
154155 GdkAtom type_returned ;
@@ -165,7 +166,8 @@ net_workarea_changed (FMDesktopIconView *icon_view,
165166 * workareas array is going to be (each desktop will have four
166167 * elements in the workareas array describing
167168 * x,y,width,height) */
168- gdk_error_trap_push ();
169+ display = gtk_widget_get_display (GTK_WIDGET (icon_view ));
170+ gdk_x11_display_error_trap_push (display );
169171 if (!gdk_property_get (window ,
170172 gdk_atom_intern ("_NET_NUMBER_OF_DESKTOPS" , FALSE),
171173 gdk_x11_xatom_to_atom (XA_CARDINAL ),
@@ -177,7 +179,7 @@ net_workarea_changed (FMDesktopIconView *icon_view,
177179 {
178180 g_warning ("Can not calculate _NET_NUMBER_OF_DESKTOPS" );
179181 }
180- if (gdk_error_trap_pop ( )
182+ if (gdk_x11_display_error_trap_pop ( display )
181183 || nworkareas == NULL
182184 || type_returned != gdk_x11_xatom_to_atom (XA_CARDINAL )
183185 || format_returned != 32 )
@@ -193,7 +195,7 @@ net_workarea_changed (FMDesktopIconView *icon_view,
193195 * request does not correspond to the number of bytes you get
194196 * back, and is the reason for the workaround below.
195197 */
196- gdk_error_trap_push ( );
198+ gdk_x11_display_error_trap_push ( display );
197199 if (nworkareas == NULL || (* nworkareas < 1 )
198200 || !gdk_property_get (window ,
199201 gdk_atom_intern ("_NET_WORKAREA" , FALSE),
@@ -208,7 +210,7 @@ net_workarea_changed (FMDesktopIconView *icon_view,
208210 workareas = NULL ;
209211 }
210212
211- if (gdk_error_trap_pop ( )
213+ if (gdk_x11_display_error_trap_pop ( display )
212214 || workareas == NULL
213215 || type_returned != gdk_x11_xatom_to_atom (XA_CARDINAL )
214216 || ((* nworkareas ) * 4 * sizeof (long )) != length_returned
0 commit comments