From 2019536f3ce72154858d27099c719585c0a2108e Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Tue, 6 Dec 2022 19:03:24 +0100 Subject: [PATCH] core: Wrap an extra X11 call with error trap This XChangeWindowAttributes call was never surrounded by an error trap and was not really expected to fail with BadWindow since the frame window would be owned by Mutter itself. This however is no longer true, and we might be getting a BadWindow from the frame window given the right timing. Part-of: --- src/core/frame.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core/frame.c b/src/core/frame.c index 498cee010..2f9ef82cc 100644 --- a/src/core/frame.c +++ b/src/core/frame.c @@ -99,13 +99,15 @@ meta_window_set_frame_xwindow (MetaWindow *window, create_serial); meta_verbose ("Frame for %s is 0x%lx", frame->window->desc, frame->xwindow); + + meta_x11_error_trap_push (x11_display); + attrs.event_mask = EVENT_MASK; XChangeWindowAttributes (x11_display->xdisplay, frame->xwindow, CWEventMask, &attrs); meta_x11_display_register_x_window (x11_display, &frame->xwindow, window); - meta_x11_error_trap_push (x11_display); if (window->mapped) { window->mapped = FALSE; /* the reparent will unmap the window,