summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorraveit65 <[email protected]>2018-06-28 18:04:00 +0200
committerraveit65 <[email protected]>2018-06-28 20:53:03 +0200
commitcb34c543087b2d3718c8366cb707e1fe30520129 (patch)
tree6d037fc80c7b8e29d355018bff8bcb9a7f892585
parent08076debace1dc487d946e0fe1d5328a9e4639ed (diff)
downloadmate-panel-cb34c543087b2d3718c8366cb707e1fe30520129.tar.bz2
mate-panel-cb34c543087b2d3718c8366cb707e1fe30520129.tar.xz
panel-force-quit: replace deprecated gdk_error_trap functions
-rw-r--r--mate-panel/panel-force-quit.c30
1 files changed, 17 insertions, 13 deletions
diff --git a/mate-panel/panel-force-quit.c b/mate-panel/panel-force-quit.c
index ff6fdd12..90f5065e 100644
--- a/mate-panel/panel-force-quit.c
+++ b/mate-panel/panel-force-quit.c
@@ -122,9 +122,10 @@ remove_popup (GtkWidget *popup)
}
static gboolean
-wm_state_set (Display *display,
+wm_state_set (Display *xdisplay,
Window window)
{
+ GdkDisplay *display;
gulong nitems;
gulong bytes_after;
gulong *prop;
@@ -132,13 +133,14 @@ wm_state_set (Display *display,
int ret_format;
int result;
- gdk_error_trap_push ();
- result = XGetWindowProperty (display, window, wm_state_atom,
+ display = gdk_display_get_default ();
+ gdk_x11_display_error_trap_push (display);
+ result = XGetWindowProperty (xdisplay, window, wm_state_atom,
0, G_MAXLONG, False, wm_state_atom,
&ret_type, &ret_format, &nitems,
&bytes_after, (gpointer) &prop);
- if (gdk_error_trap_pop ())
+ if (gdk_x11_display_error_trap_pop (display))
return FALSE;
if (result != Success)
@@ -153,9 +155,10 @@ wm_state_set (Display *display,
}
static Window
-find_managed_window (Display *display,
+find_managed_window (Display *xdisplay,
Window window)
{
+ GdkDisplay *display;
Window root;
Window parent;
Window *kids = NULL;
@@ -163,23 +166,24 @@ find_managed_window (Display *display,
guint nkids;
int i, result;
- if (wm_state_set (display, window))
+ if (wm_state_set (xdisplay, window))
return window;
- gdk_error_trap_push ();
- result = XQueryTree (display, window, &root, &parent, &kids, &nkids);
- if (gdk_error_trap_pop () || !result)
+ display = gdk_display_get_default ();
+ gdk_x11_display_error_trap_push (display);
+ result = XQueryTree (xdisplay, window, &root, &parent, &kids, &nkids);
+ if (gdk_x11_display_error_trap_pop (display) || !result)
return None;
retval = None;
for (i = 0; i < nkids; i++) {
- if (wm_state_set (display, kids [i])) {
+ if (wm_state_set (xdisplay, kids [i])) {
retval = kids [i];
break;
}
- retval = find_managed_window (display, kids [i]);
+ retval = find_managed_window (xdisplay, kids [i]);
if (retval != None)
break;
}
@@ -203,10 +207,10 @@ kill_window_response (GtkDialog *dialog,
display = gtk_widget_get_display (GTK_WIDGET (dialog));
xdisplay = GDK_DISPLAY_XDISPLAY (display);
- gdk_error_trap_push ();
+ gdk_x11_display_error_trap_push (display);
XKillClient (xdisplay, window);
gdk_display_flush (display);
- gdk_error_trap_pop_ignored ();
+ gdk_x11_display_error_trap_pop_ignored (display);
}
gtk_widget_destroy (GTK_WIDGET (dialog));