summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorraveit65 <[email protected]>2018-06-08 16:28:42 +0200
committerraveit65 <[email protected]>2018-06-10 14:32:25 +0200
commitf6d429e01de132233c5288616e57772e687358bf (patch)
tree885512a6a378150b3c427e7425d94e561861dd28
parent9edbc591d23410e5a1da9528822f9d58eea6a68e (diff)
downloadmate-control-center-f6d429e01de132233c5288616e57772e687358bf.tar.bz2
mate-control-center-f6d429e01de132233c5288616e57772e687358bf.tar.xz
wm-common: replace deprecated gdk_error_trap functions
-rw-r--r--capplets/common/wm-common.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/capplets/common/wm-common.c b/capplets/common/wm-common.c
index 268f587c..a8a31bcb 100644
--- a/capplets/common/wm-common.c
+++ b/capplets/common/wm-common.c
@@ -19,6 +19,7 @@ static char *
wm_common_get_window_manager_property (Atom atom)
{
Atom utf8_string, type;
+ GdkDisplay *display;
int result;
char *retval;
int format;
@@ -31,10 +32,11 @@ wm_common_get_window_manager_property (Atom atom)
utf8_string = gdk_x11_get_xatom_by_name ("UTF8_STRING");
- gdk_error_trap_push ();
+ display = gdk_display_get_default ();
+ gdk_x11_display_error_trap_push (display);
val = NULL;
- result = XGetWindowProperty (GDK_DISPLAY_XDISPLAY(gdk_display_get_default()),
+ result = XGetWindowProperty (GDK_DISPLAY_XDISPLAY(display),
wm_window,
atom,
0, G_MAXLONG,
@@ -42,7 +44,7 @@ wm_common_get_window_manager_property (Atom atom)
&type, &format, &nitems,
&bytes_after, (guchar **) &val);
- if (gdk_error_trap_pop () || result != Success ||
+ if (gdk_x11_display_error_trap_pop (display) || result != Success ||
type != utf8_string || format != 8 || nitems == 0 ||
!g_utf8_validate (val, nitems, NULL))
{
@@ -105,13 +107,15 @@ wm_common_get_current_keybindings (void)
static void
update_wm_window (void)
{
+ GdkDisplay *display;
Window *xwindow;
Atom type;
gint format;
gulong nitems;
gulong bytes_after;
- XGetWindowProperty (GDK_DISPLAY_XDISPLAY(gdk_display_get_default()), GDK_ROOT_WINDOW (),
+ display = gdk_display_get_default ();
+ XGetWindowProperty (GDK_DISPLAY_XDISPLAY(display), GDK_ROOT_WINDOW (),
gdk_x11_get_xatom_by_name ("_NET_SUPPORTING_WM_CHECK"),
0, G_MAXLONG, False, XA_WINDOW, &type, &format,
&nitems, &bytes_after, (guchar **) &xwindow);
@@ -122,11 +126,11 @@ update_wm_window (void)
return;
}
- gdk_error_trap_push ();
- XSelectInput (GDK_DISPLAY_XDISPLAY(gdk_display_get_default()), *xwindow, StructureNotifyMask | PropertyChangeMask);
- XSync (GDK_DISPLAY_XDISPLAY(gdk_display_get_default()), False);
+ gdk_x11_display_error_trap_push (display);
+ XSelectInput (GDK_DISPLAY_XDISPLAY(display), *xwindow, StructureNotifyMask | PropertyChangeMask);
+ XSync (GDK_DISPLAY_XDISPLAY(display), False);
- if (gdk_error_trap_pop ())
+ if (gdk_x11_display_error_trap_pop (display))
{
XFree (xwindow);
wm_window = None;