diff --git a/src/x11window.cpp b/src/x11window.cpp index cfe6dae6f5..a16038e2b3 100644 --- a/src/x11window.cpp +++ b/src/x11window.cpp @@ -656,6 +656,18 @@ bool X11Window::manage(xcb_window_t w, bool isMapped) getSyncCounter(); setCaption(readName()); + if (Compositor::compositing()) { + // Sending ConfigureNotify is done when setting mapping state below, getting the + // first sync response means window is ready for compositing. + // + // The sync request will block wl_surface commits, and with Xwayland, it is really + // important that wl_surfaces commits are blocked before the frame window is mapped. + // Otherwise Xwayland can attach a buffer before the sync request is acked. + sendSyncRequest(); + } else { + ready_for_painting = true; // set to true in case compositing is turned on later + } + setupWindowRules(); connect(this, &X11Window::windowClassChanged, this, &X11Window::evaluateWindowRules); @@ -1103,14 +1115,6 @@ bool X11Window::manage(xcb_window_t w, bool isMapped) workspace()->restoreSessionStackingOrder(this); } - if (Compositor::compositing()) { - // Sending ConfigureNotify is done when setting mapping state below, - // Getting the first sync response means window is ready for compositing - sendSyncRequest(); - } else { - ready_for_painting = true; // set to true in case compositing is turned on later. bug #160393 - } - if (isShown()) { bool allow; if (session) {