diff --git a/src/layers.cpp b/src/layers.cpp index efa4391356..1c3453a29d 100644 --- a/src/layers.cpp +++ b/src/layers.cpp @@ -293,6 +293,10 @@ void Workspace::lowerWindow(Window *window, bool nogroup) if (!window) { return; } + if (window->isDeleted()) { + qCWarning(KWIN_CORE) << "Workspace::lowerWindow: closed window" << window << "cannot be restacked"; + return; + } window->cancelAutoRaise(); @@ -319,6 +323,10 @@ void Workspace::lowerWindowWithinApplication(Window *window) if (!window) { return; } + if (window->isDeleted()) { + qCWarning(KWIN_CORE) << "Workspace::lowerWindowWithinApplication: closed window" << window << "cannot be restacked"; + return; + } window->cancelAutoRaise(); @@ -349,6 +357,10 @@ void Workspace::raiseWindow(Window *window, bool nogroup) if (!window) { return; } + if (window->isDeleted()) { + qCWarning(KWIN_CORE) << "Workspace::raiseWindow: closed window" << window << "cannot be restacked"; + return; + } window->cancelAutoRaise(); @@ -374,6 +386,10 @@ void Workspace::raiseWindowWithinApplication(Window *window) if (!window) { return; } + if (window->isDeleted()) { + qCWarning(KWIN_CORE) << "Workspace::raiseWindowWithinApplication: closed window" << window << "cannot be restacked"; + return; + } window->cancelAutoRaise(); @@ -427,6 +443,10 @@ void Workspace::lowerWindowRequest(Window *window) void Workspace::restack(Window *window, Window *under, bool force) { + if (window->isDeleted()) { + qCWarning(KWIN_CORE) << "Workspace::restack: closed window" << window << "cannot be restacked"; + return; + } Q_ASSERT(unconstrained_stacking_order.contains(under)); if (!force && !Window::belongToSameApplication(under, window)) { // put in the stacking order below _all_ windows belonging to the active application