diff --git a/src/focuschain.cpp b/src/focuschain.cpp index 96a4e87a80..57d5e240d5 100644 --- a/src/focuschain.cpp +++ b/src/focuschain.cpp @@ -116,7 +116,9 @@ void FocusChain::updateWindowInChain(Window *window, FocusChain::Change change, void FocusChain::insertWindowIntoChain(Window *window, Chain &chain) { - Q_ASSERT(!window->isDeleted()); + if (window->isDeleted()) { + return; + } if (chain.contains(window)) { return; } @@ -131,7 +133,9 @@ void FocusChain::insertWindowIntoChain(Window *window, Chain &chain) void FocusChain::moveAfterWindow(Window *window, Window *reference) { - Q_ASSERT(!window->isDeleted()); + if (window->isDeleted()) { + return; + } if (!window->wantsTabFocus()) { return; } @@ -149,7 +153,9 @@ void FocusChain::moveAfterWindow(Window *window, Window *reference) void FocusChain::moveAfterWindowInChain(Window *window, Window *reference, Chain &chain) { - Q_ASSERT(!window->isDeleted()); + if (window->isDeleted()) { + return; + } if (!chain.contains(reference)) { return; } @@ -214,14 +220,18 @@ Window *FocusChain::nextForDesktop(Window *reference, VirtualDesktop *desktop) c void FocusChain::makeFirstInChain(Window *window, Chain &chain) { - Q_ASSERT(!window->isDeleted()); + if (window->isDeleted()) { + return; + } chain.removeAll(window); chain.append(window); } void FocusChain::makeLastInChain(Window *window, Chain &chain) { - Q_ASSERT(!window->isDeleted()); + if (window->isDeleted()) { + return; + } chain.removeAll(window); chain.prepend(window); }