[Xfce4-commits] [apps/xfce4-screensaver] 389/425: Fix various GdkDisplay issues

noreply at xfce.org noreply at xfce.org
Mon Oct 15 01:53:56 CEST 2018


This is an automated email from the git hooks/post-receive script.

b   l   u   e   s   a   b   r   e       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository apps/xfce4-screensaver.

commit 2126a674e4dd139e30482801463ca5729dc28ff0
Author: Sean Davis <smd.seandavis at gmail.com>
Date:   Thu Oct 11 05:49:39 2018 -0400

    Fix various GdkDisplay issues
---
 savers/floaters.c   |  5 ++++-
 src/gs-fade.c       |  2 +-
 src/gs-grab-x11.c   | 10 +++++-----
 src/gs-manager.c    |  4 ++--
 src/gs-window-x11.c | 32 +++++++++++++++++++++-----------
 5 files changed, 33 insertions(+), 20 deletions(-)

diff --git a/savers/floaters.c b/savers/floaters.c
index 2b489a2..a78a6c1 100644
--- a/savers/floaters.c
+++ b/savers/floaters.c
@@ -1110,7 +1110,10 @@ screen_saver_do_update_state (ScreenSaver *screen_saver)
 	 */
 	if (screen_saver->draw_ops_pending)
 	{
-		gdk_display_flush (gdk_display_get_default());;
+		GdkDisplay *display;
+
+		display = gtk_widget_get_display (GTK_WIDGET(screen_saver->drawing_area));
+		gdk_display_flush (display);
 		screen_saver->draw_ops_pending = FALSE;
 	}
 
diff --git a/src/gs-fade.c b/src/gs-fade.c
index 0ac7202..184f3bc 100644
--- a/src/gs-fade.c
+++ b/src/gs-fade.c
@@ -243,7 +243,7 @@ xf86_whack_gamma (int              screen,
 # endif /* !HAVE_XF86VMODE_GAMMA_RAMP */
 	}
 
-	gdk_display_flush (gdk_display_get_default());;
+	gdk_display_flush (gdk_display_get_default());
 
 	return status;
 }
diff --git a/src/gs-grab-x11.c b/src/gs-grab-x11.c
index c1efbb7..f090646 100644
--- a/src/gs-grab-x11.c
+++ b/src/gs-grab-x11.c
@@ -259,8 +259,8 @@ gs_grab_release (GSGrab *grab, gboolean flush)
 		/* FIXME: is it right to enable this? */
 		xorg_lock_smasher_set_active (grab, TRUE);
 
-		gdk_display_sync (gdk_display_get_default ());
-		gdk_display_flush (gdk_display_get_default());;
+		gdk_display_sync (display);
+		gdk_display_flush (display);
 	}
 }
 
@@ -345,13 +345,13 @@ gs_grab_nuke_focus (GdkDisplay *display)
 
 	gs_debug ("Nuking focus");
 
-	gdk_x11_display_error_trap_push (gdk_display_get_default());;
+	gdk_x11_display_error_trap_push (display);
 
 	XGetInputFocus (GDK_DISPLAY_XDISPLAY (display), &focus, &rev);
 	XSetInputFocus (GDK_DISPLAY_XDISPLAY (display), None,
 	                RevertToNone, CurrentTime);
 
-	gdk_x11_display_error_trap_pop_ignored (gdk_display_get_default());;
+	gdk_x11_display_error_trap_pop_ignored (display);
 }
 
 gboolean
@@ -461,7 +461,7 @@ gs_grab_move_to_window (GSGrab     *grab,
 	{
 		result = gs_grab_move (grab, window, display,
 		                       no_pointer_grab, hide_cursor);
-		gdk_display_flush (gdk_display_get_default());;
+		gdk_display_flush (display);
 	}
 }
 
diff --git a/src/gs-manager.c b/src/gs-manager.c
index 1a3e441..72e5c1f 100644
--- a/src/gs-manager.c
+++ b/src/gs-manager.c
@@ -1174,7 +1174,7 @@ manager_maybe_grab_window (GSManager *manager,
 	gdk_device_get_position (device, NULL, &x, &y);
 	monitor = gdk_display_get_monitor_at_point (display, x, y);
 
-	gdk_display_flush (gdk_display_get_default());;
+	gdk_display_flush (display);
 	grabbed = FALSE;
 	if (gs_window_get_display (window) == display &&
 	    gs_window_get_monitor (window) == monitor)
@@ -1646,7 +1646,7 @@ on_screen_monitors_changed (GdkScreen *screen,
 			gs_manager_request_unlock (manager);
 		}
 
-		gdk_display_flush (gdk_display_get_default());;
+		gdk_display_flush (display);
 		gdk_x11_ungrab_server ();
 	}
 }
diff --git a/src/gs-window-x11.c b/src/gs-window-x11.c
index 1de4ecf..ce473e9 100644
--- a/src/gs-window-x11.c
+++ b/src/gs-window-x11.c
@@ -232,16 +232,18 @@ static void
 widget_clear_all_children (GtkWidget *widget)
 {
 	GdkWindow *w;
+	GdkDisplay *display;
 
 	gs_debug ("Clearing all child windows");
+	display = gtk_widget_get_display (widget);
 
-	gdk_x11_display_error_trap_push (gdk_display_get_default());;
+	gdk_x11_display_error_trap_push (display);
 
 	w = gtk_widget_get_window (widget);
 
 	clear_children (GDK_WINDOW_XID (w));
 
-	gdk_x11_display_error_trap_pop_ignored (gdk_display_get_default());;
+	gdk_x11_display_error_trap_pop_ignored (display);
 }
 
 void
@@ -267,6 +269,7 @@ gs_window_set_background_surface (GSWindow        *window,
 void
 gs_window_clear (GSWindow *window)
 {
+	GdkDisplay *display;
 	g_return_if_fail (GS_IS_WINDOW (window));
 
 	gs_debug ("Clearing widgets");
@@ -285,7 +288,8 @@ gs_window_clear (GSWindow *window)
 		widget_clear_all_children (window->priv->drawing_area);
 	}
 
-	gdk_display_flush (gdk_display_get_default());;
+	display = gtk_widget_get_display (GTK_WIDGET(window));
+	gdk_display_flush (display);
 }
 
 static cairo_region_t *
@@ -764,16 +768,19 @@ select_popup_events (void)
 {
 	XWindowAttributes attr;
 	unsigned long     events;
+	GdkDisplay *display;
 
-	gdk_x11_display_error_trap_push (gdk_display_get_default());;
+	display = gdk_display_get_default ();
+
+	gdk_x11_display_error_trap_push (display);
 
 	memset (&attr, 0, sizeof (attr));
-	XGetWindowAttributes (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), GDK_ROOT_WINDOW (), &attr);
+	XGetWindowAttributes (GDK_DISPLAY_XDISPLAY (display), GDK_ROOT_WINDOW (), &attr);
 
 	events = SubstructureNotifyMask | attr.your_event_mask;
-	XSelectInput (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), GDK_ROOT_WINDOW (), events);
+	XSelectInput (GDK_DISPLAY_XDISPLAY (display), GDK_ROOT_WINDOW (), events);
 
-	gdk_x11_display_error_trap_pop_ignored (gdk_display_get_default());;
+	gdk_x11_display_error_trap_pop_ignored (display);
 }
 
 static void
@@ -782,15 +789,18 @@ window_select_shape_events (GSWindow *window)
 #ifdef HAVE_SHAPE_EXT
 	unsigned long events;
 	int           shape_error_base;
+	GdkDisplay *display;
+
+	display = gtk_widget_get_display (GTK_WIDGET(window));
 
-	gdk_x11_display_error_trap_push (gdk_display_get_default());;
+	gdk_x11_display_error_trap_push (display);
 
-	if (XShapeQueryExtension (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), &window->priv->shape_event_base, &shape_error_base)) {
+	if (XShapeQueryExtension (GDK_DISPLAY_XDISPLAY (display), &window->priv->shape_event_base, &shape_error_base)) {
 		events = ShapeNotifyMask;
-		XShapeSelectInput (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), GDK_WINDOW_XID (gtk_widget_get_window (GTK_WIDGET (window))), events);
+		XShapeSelectInput (GDK_DISPLAY_XDISPLAY (display), GDK_WINDOW_XID (gtk_widget_get_window (GTK_WIDGET (window))), events);
 	}
 
-	gdk_x11_display_error_trap_pop_ignored (gdk_display_get_default());;
+	gdk_x11_display_error_trap_pop_ignored (display);
 #endif
 }
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list