summaryrefslogtreecommitdiff
path: root/src/x11/events.c
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2022-12-06 15:00:51 +0100
committerCarlos Garnacho <carlosg@gnome.org>2023-01-12 14:00:52 +0100
commit8789e1b7d904e109e132425200816489a0a5b056 (patch)
tree43e9e94c4e3140008dbb7a5e12d2490c4f3bf8fd /src/x11/events.c
parent1cee0579fa67f427537e0800d67703661b0b4cda (diff)
downloadmutter-8789e1b7d904e109e132425200816489a0a5b056.tar.gz
x11: Push error trap querying the _MUTTER_FRAME_FOR property
It is a possibility that this request results in an error, so handle the possible fallout. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2745>
Diffstat (limited to 'src/x11/events.c')
-rw-r--r--src/x11/events.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/x11/events.c b/src/x11/events.c
index 52635f1fd..7383451b3 100644
--- a/src/x11/events.c
+++ b/src/x11/events.c
@@ -1490,13 +1490,23 @@ handle_other_xevent (MetaX11Display *x11_display,
unsigned long nitems, bytes_after, *data;
/* Check whether the new window is a frame for another window */
+ meta_x11_error_trap_push (x11_display);
+
if (XGetWindowProperty (x11_display->xdisplay,
event->xmaprequest.window,
x11_display->atom__MUTTER_FRAME_FOR,
0, 32, False, XA_WINDOW,
&type, &format, &nitems, &bytes_after,
- (guchar **) &data) == Success &&
- nitems == 1)
+ (guchar **) &data) != Success)
+ {
+ meta_x11_error_trap_pop (x11_display);
+ break;
+ }
+
+ if (meta_x11_error_trap_pop_with_return (x11_display) != Success)
+ break;
+
+ if (nitems == 1)
{
Window client_window;