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>
This commit is contained in:
Carlos Garnacho 2022-12-06 15:00:51 +01:00
parent 1cee0579fa
commit 8789e1b7d9

View File

@ -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;