summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/gs-fade.c4
-rw-r--r--src/gs-grab-x11.c10
-rw-r--r--src/gs-manager.c4
-rw-r--r--src/gs-window-x11.c33
4 files changed, 32 insertions, 19 deletions
diff --git a/src/gs-fade.c b/src/gs-fade.c
index f949ee5..156d7e2 100644
--- a/src/gs-fade.c
+++ b/src/gs-fade.c
@@ -174,6 +174,7 @@ xf86_whack_gamma (int screen,
{
Bool status;
struct GSGammaInfo *gamma_info;
+ GdkDisplay *display;
gamma_info = screen_priv->info;
@@ -243,7 +244,8 @@ xf86_whack_gamma (int screen,
# endif /* !HAVE_XF86VMODE_GAMMA_RAMP */
}
- gdk_flush ();
+ display = gdk_display_get_default ();
+ gdk_display_flush (display);
return status;
}
diff --git a/src/gs-grab-x11.c b/src/gs-grab-x11.c
index 18066a4..6e13b91 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_flush ();
+ gdk_display_sync (display);
+ gdk_display_flush (display);
}
}
@@ -345,13 +345,13 @@ gs_grab_nuke_focus (GdkDisplay *display)
gs_debug ("Nuking focus");
- gdk_error_trap_push ();
+ gdk_x11_display_error_trap_push (display);
XGetInputFocus (GDK_DISPLAY_XDISPLAY (display), &focus, &rev);
XSetInputFocus (GDK_DISPLAY_XDISPLAY (display), None,
RevertToNone, CurrentTime);
- gdk_error_trap_pop_ignored ();
+ 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_flush ();
+ gdk_display_flush (display);
}
}
diff --git a/src/gs-manager.c b/src/gs-manager.c
index fe2e4fe..3774705 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_flush ();
+ gdk_display_flush (display);
grabbed = FALSE;
if (gs_window_get_display (window) == display &&
gs_window_get_monitor (window) == monitor)
@@ -1638,7 +1638,7 @@ on_screen_monitors_changed (GdkScreen *screen,
gs_manager_request_unlock (manager);
}
- gdk_flush ();
+ gdk_display_flush (display);
gdk_x11_ungrab_server ();
}
}
diff --git a/src/gs-window-x11.c b/src/gs-window-x11.c
index c15c15a..e5b857c 100644
--- a/src/gs-window-x11.c
+++ b/src/gs-window-x11.c
@@ -232,16 +232,19 @@ 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_error_trap_push ();
+ gdk_x11_display_error_trap_push (display);
w = gtk_widget_get_window (widget);
clear_children (GDK_WINDOW_XID (w));
- gdk_error_trap_pop_ignored ();
+ gdk_x11_display_error_trap_pop_ignored (display);
+
}
void
@@ -267,6 +270,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 +289,8 @@ gs_window_clear (GSWindow *window)
widget_clear_all_children (window->priv->drawing_area);
}
- gdk_flush ();
+ display = gtk_widget_get_display (GTK_WIDGET(window));
+ gdk_display_flush (display);
}
static cairo_region_t *
@@ -764,16 +769,19 @@ select_popup_events (void)
{
XWindowAttributes attr;
unsigned long events;
+ GdkDisplay *display;
- gdk_error_trap_push ();
+ 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_error_trap_pop_ignored ();
+ gdk_x11_display_error_trap_pop_ignored (display);
}
static void
@@ -782,15 +790,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_error_trap_push ();
+ 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_error_trap_pop_ignored ();
+ gdk_x11_display_error_trap_pop_ignored (display);
#endif
}