From 6982c506a5ae4af6d43da6c3a99814c6a7303247 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Tue, 9 Aug 2022 15:23:34 +0300 Subject: [PATCH] wayland: Setup window management when starting to manage X11 window We don't need to wait until the window is ready for painting in order to create a plasma window, in fact, quite the opposite is desired. It's better if the plasma window is created in manage() so the task manager displays the corresponding item even if the window is not showing up for whatever reason. --- src/x11window.cpp | 5 ++--- src/xwaylandwindow.cpp | 1 - 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/x11window.cpp b/src/x11window.cpp index a6ce4054d4..313b8a8ef9 100644 --- a/src/x11window.cpp +++ b/src/x11window.cpp @@ -962,6 +962,8 @@ bool X11Window::manage(xcb_window_t w, bool isMapped) setBlockingCompositing(info->isBlockingCompositing()); readShowOnScreenEdge(showOnScreenEdgeCookie); + setupWindowManagementInterface(); + // Forward all opacity values to the frame in case there'll be other CM running. connect(Compositor::self(), &Compositor::compositingToggled, this, [this](bool active) { if (active) { @@ -2348,7 +2350,6 @@ void X11Window::sendSyncRequest() if (!ready_for_painting) { // failed on initial pre-show request setReadyForPainting(); - setupWindowManagementInterface(); return; } // failed during resize @@ -2844,7 +2845,6 @@ void X11Window::checkApplicationMenuObjectPath() void X11Window::handleSync() { setReadyForPainting(); - setupWindowManagementInterface(); m_syncRequest.isPending = false; if (m_syncRequest.failsafeTimeout) { m_syncRequest.failsafeTimeout->stop(); @@ -4874,7 +4874,6 @@ void X11Window::damageNotifyEvent() if (!readyForPainting()) { // avoid "setReadyForPainting()" function calling overhead if (m_syncRequest.counter == XCB_NONE) { // cannot detect complete redraw, consider done now setReadyForPainting(); - setupWindowManagementInterface(); } } diff --git a/src/xwaylandwindow.cpp b/src/xwaylandwindow.cpp index fa160c18ed..32fac66ec8 100644 --- a/src/xwaylandwindow.cpp +++ b/src/xwaylandwindow.cpp @@ -37,7 +37,6 @@ void XwaylandWindow::initialize() if (!readyForPainting()) { // avoid "setReadyForPainting()" function calling overhead if (syncRequest().counter == XCB_NONE) { // cannot detect complete redraw, consider done now setReadyForPainting(); - setupWindowManagementInterface(); } } }