summaryrefslogtreecommitdiff
path: root/src/gs-window-x11.c
diff options
context:
space:
mode:
authoryetist <[email protected]>2018-05-12 13:39:47 +0800
committerraveit65 <[email protected]>2018-05-14 21:22:26 +0200
commitabaa88eaf6b495949199afd5886a519f89c39f36 (patch)
treeeddcfc03740c765d59344ff0fdf81b79455dfd81 /src/gs-window-x11.c
parentce87b58ea6349d0a2b48ae1f7f01d5783027f7f5 (diff)
downloadmate-screensaver-abaa88eaf6b495949199afd5886a519f89c39f36.tar.bz2
mate-screensaver-abaa88eaf6b495949199afd5886a519f89c39f36.tar.xz
Fixed some gdk deprecations
Diffstat (limited to 'src/gs-window-x11.c')
-rw-r--r--src/gs-window-x11.c33
1 files changed, 22 insertions, 11 deletions
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
}