scene: Sync Window::readyForPainting() to window item visibility

If a window is made ready for painting with some delay, the item won't
schedule an update. To fix that, sync the item visibility state with
Window::readyForPainting(). When the item visibility changes, a repaint
will be scheduled.

BUG: 464955
This commit is contained in:
Vlad Zahorodnii 2023-02-02 20:08:11 +02:00
parent 2babccda04
commit 37c4a4536e
2 changed files with 5 additions and 6 deletions

View file

@ -126,6 +126,9 @@ void WindowItem::handleWindowClosed(Window *original, Deleted *deleted)
bool WindowItem::computeVisibility() const
{
if (!m_window->readyForPainting()) {
return false;
}
if (waylandServer() && waylandServer()->isScreenLocked()) {
return m_window->isLockScreen() || m_window->isInputMethod() || m_window->isLockScreenOverlay();
}

View file

@ -443,13 +443,9 @@ void WorkspaceScene::createStackingOrder()
// window should not get focus before it's displayed, handle unredirected windows properly and
// so on.
for (Window *window : std::as_const(windows)) {
if (!window->readyForPainting()) {
continue;
if (window->windowItem()->isVisible()) {
stacking_order.append(window->windowItem());
}
if (!window->windowItem()->isVisible()) {
continue;
}
stacking_order.append(window->windowItem());
}
}