workspace: fix syncing the stacking order with Xorg

Deleted windows have frameId zero, which makes Xorg stack other windows
below the bottom-most window instead of the correct one. To avoid that,
filter out deleted windows in Workspace::propagateWindows.

BUG: 478556
This commit is contained in:
Vyacheslav Mayorov 2024-05-03 17:34:21 +03:00
parent 33fe211471
commit 4e01d2c8b7

View file

@ -165,7 +165,7 @@ void Workspace::propagateWindows(bool propagate_new_windows)
for (int i = stacking_order.size() - 1; i >= 0; --i) { for (int i = stacking_order.size() - 1; i >= 0; --i) {
X11Window *window = qobject_cast<X11Window *>(stacking_order.at(i)); X11Window *window = qobject_cast<X11Window *>(stacking_order.at(i));
if (!window || window->isUnmanaged() || window->hiddenPreview()) { if (!window || window->isDeleted() || window->isUnmanaged() || window->hiddenPreview()) {
continue; continue;
} }
@ -182,7 +182,7 @@ void Workspace::propagateWindows(bool propagate_new_windows)
// these windows that should be unmapped to interfere with other windows // these windows that should be unmapped to interfere with other windows
for (int i = stacking_order.size() - 1; i >= 0; --i) { for (int i = stacking_order.size() - 1; i >= 0; --i) {
X11Window *window = qobject_cast<X11Window *>(stacking_order.at(i)); X11Window *window = qobject_cast<X11Window *>(stacking_order.at(i));
if (!window || window->isUnmanaged() || !window->hiddenPreview()) { if (!window || window->isDeleted() || window->isUnmanaged() || !window->hiddenPreview()) {
continue; continue;
} }
newWindowStack << window->frameId(); newWindowStack << window->frameId();