diff --git a/effects/coverswitch/coverswitch.cpp b/effects/coverswitch/coverswitch.cpp index 4728689929..9f462f172c 100644 --- a/effects/coverswitch/coverswitch.cpp +++ b/effects/coverswitch/coverswitch.cpp @@ -988,6 +988,8 @@ void CoverSwitchEffect::abort() void CoverSwitchEffect::slotWindowClosed(EffectWindow* c) { + if (c == selected_window) + selected_window = 0; // if the list is not empty, the effect is active if (!currentWindowList.isEmpty()) { c->refWindow(); diff --git a/effects/flipswitch/flipswitch.cpp b/effects/flipswitch/flipswitch.cpp index 192d847914..12dddbf40f 100644 --- a/effects/flipswitch/flipswitch.cpp +++ b/effects/flipswitch/flipswitch.cpp @@ -591,6 +591,8 @@ void FlipSwitchEffect::slotWindowAdded(EffectWindow* w) void FlipSwitchEffect::slotWindowClosed(EffectWindow* w) { + if (m_selectedWindow == w) + m_selectedWindow = 0; if (m_active && m_windows.contains(w)) { m_windows.remove(w); }