summaryrefslogtreecommitdiff
path: root/src/misc.c
diff options
context:
space:
mode:
authorOlivier Fourdan <fourdan@xfce.org>2019-05-02 13:12:53 +0200
committerOlivier Fourdan <fourdan@xfce.org>2019-05-02 16:01:26 +0200
commite8e920cb170645449dc2367a29175f2bbbd4e61e (patch)
treec06769ca35d2a877e007951ec51e242bc47c6f1b /src/misc.c
parentba3ed23733edb9b96bfab89a67d3cea5afc73e1b (diff)
downloadxfwm4-e8e920cb170645449dc2367a29175f2bbbd4e61e.tar.gz
events: Catch more XErrors
Many operations such as XI2's grab/ungrab can cause an XError for various reasons, and X11 being asynchronous, those may end up being caught in gdk's own code, causing the termination of xfwm4. Catch XErrors in the relevant portions in xfwm4 code with error trap push/pop before gdk get them. Signed-off-by: Olivier Fourdan <fourdan@xfce.org>
Diffstat (limited to 'src/misc.c')
-rw-r--r--src/misc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/misc.c b/src/misc.c
index 3685916d9..080b1f096 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -53,7 +53,9 @@ getMouseXY (ScreenInfo *screen_info, Window w, gint *x2, gint *y2)
TRACE ("window (0x%lx)", w);
+ myDisplayErrorTrapPush (screen_info->display_info);
XQueryPointer (myScreenGetXDisplay (screen_info), w, &w1, &w2, &x1, &y1, x2, y2, &mask);
+ myDisplayErrorTrapPopIgnored (screen_info->display_info);
return mask;
}
@@ -108,7 +110,9 @@ sendClientMessage (ScreenInfo *screen_info, Window w, int atom_id, guint32 times
ev.send_event = TRUE;
ev.data.l[0] = display_info->atoms[atom_id];
ev.data.l[1] = timestamp;
+ myDisplayErrorTrapPush (screen_info->display_info);
XSendEvent (myScreenGetXDisplay (screen_info), w, FALSE, 0L, (XEvent *)&ev);
+ myDisplayErrorTrapPopIgnored (screen_info->display_info);
}
void