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
remotes/origin/work/redstrate/dials
Vlad Zahorodnii 3 years ago
parent 2babccda04
commit 37c4a4536e
  1. 3
      src/scene/windowitem.cpp
  2. 8
      src/scene/workspacescene.cpp

@ -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();
}

@ -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());
}
}

Loading…
Cancel
Save