@@ -1176,17 +1176,17 @@ static gboolean fullscreen_window_exists(GtkWidget* nw)
11761176 return FALSE;
11771177}
11781178
1179- static Window get_window_parent (Display * display , Window window , Window * root )
1179+ static Window get_window_parent (GdkDisplay * display , Window window , Window * root )
11801180{
11811181 Window parent ;
11821182 Window * children = NULL ;
11831183 guint nchildren ;
11841184 gboolean result ;
11851185
1186- gdk_error_trap_push ( );
1187- result = XQueryTree (display , window , root , & parent , & children , & nchildren );
1186+ gdk_x11_display_error_trap_push ( display );
1187+ result = XQueryTree (GDK_DISPLAY_XDISPLAY ( display ) , window , root , & parent , & children , & nchildren );
11881188
1189- if (gdk_error_trap_pop ( ) || !result )
1189+ if (gdk_x11_display_error_trap_pop ( display ) || !result )
11901190 {
11911191 return None ;
11921192 }
@@ -1205,11 +1205,11 @@ static Window get_window_parent(Display* display, Window window, Window* root)
12051205 */
12061206static void monitor_notification_source_windows (NotifyDaemon * daemon , NotifyTimeout * nt , Window source )
12071207{
1208- Display * display ;
1208+ GdkDisplay * display ;
12091209 Window root = None ;
12101210 Window parent ;
12111211
1212- display = GDK_DISPLAY_XDISPLAY ( gdk_display_get_default () );
1212+ display = gdk_display_get_default ();
12131213
12141214 /* Start monitoring events if necessary. We don't want to
12151215 filter events unless we absolutely have to. */
@@ -1224,7 +1224,7 @@ static void monitor_notification_source_windows(NotifyDaemon *daemon, NotifyTim
12241224
12251225 for (parent = get_window_parent (display , source , & root ); parent != None && root != parent ; parent = get_window_parent (display , parent , & root ))
12261226 {
1227- XSelectInput (display , parent , StructureNotifyMask );
1227+ XSelectInput (GDK_DISPLAY_XDISPLAY ( display ) , parent , StructureNotifyMask );
12281228
12291229 g_hash_table_insert (daemon -> priv -> monitored_window_hash , GUINT_TO_POINTER (parent ), GINT_TO_POINTER (nt -> id ));
12301230 }
@@ -1233,22 +1233,22 @@ static void monitor_notification_source_windows(NotifyDaemon *daemon, NotifyTim
12331233/* Use a source X Window ID to reposition a notification. */
12341234static void sync_notification_position (NotifyDaemon * daemon , GtkWindow * nw , Window source )
12351235{
1236- Display * display ;
1236+ GdkDisplay * display ;
12371237 Status result ;
12381238 Window root ;
12391239 Window child ;
12401240 int x , y ;
12411241 unsigned int width , height ;
12421242 unsigned int border_width , depth ;
12431243
1244- display = GDK_DISPLAY_XDISPLAY ( gdk_display_get_default () );
1244+ display = gdk_display_get_default ();
12451245
1246- gdk_error_trap_push ( );
1246+ gdk_x11_display_error_trap_push ( display );
12471247
12481248 /* Get the root for this window */
1249- result = XGetGeometry (display , source , & root , & x , & y , & width , & height , & border_width , & depth );
1249+ result = XGetGeometry (GDK_DISPLAY_XDISPLAY ( display ) , source , & root , & x , & y , & width , & height , & border_width , & depth );
12501250
1251- if (gdk_error_trap_pop ( ) || !result )
1251+ if (gdk_x11_display_error_trap_pop ( display ) || !result )
12521252 {
12531253 return ;
12541254 }
@@ -1257,9 +1257,9 @@ static void sync_notification_position(NotifyDaemon* daemon, GtkWindow* nw, Wind
12571257 * Now calculate the offset coordinates for the source window from
12581258 * the root.
12591259 */
1260- gdk_error_trap_push ( );
1261- result = XTranslateCoordinates (display , source , root , 0 , 0 , & x , & y , & child );
1262- if (gdk_error_trap_pop ( ) || !result )
1260+ gdk_x11_display_error_trap_push ( display );
1261+ result = XTranslateCoordinates (GDK_DISPLAY_XDISPLAY ( display ) , source , root , 0 , 0 , & x , & y , & child );
1262+ if (gdk_x11_display_error_trap_pop ( display ) || !result )
12631263 {
12641264 return ;
12651265 }
0 commit comments