diff --git a/input.cpp b/input.cpp --- a/input.cpp +++ b/input.cpp @@ -1195,6 +1195,7 @@ if (!TabBox::TabBox::self() || !TabBox::TabBox::self()->isGrabbed()) { return false; } + workspace()->activateClient(nullptr); auto seat = waylandServer()->seat(); seat->setFocusedKeyboardSurface(nullptr); // pass the key event to the seat, so that it has a proper model of the currently hold keys diff --git a/tabbox/tabbox.cpp b/tabbox/tabbox.cpp --- a/tabbox/tabbox.cpp +++ b/tabbox/tabbox.cpp @@ -924,7 +924,7 @@ return false; case QEvent::MouseButtonPress: if ((!m_isShown && isDisplayed()) || !m_tabBox->containsPos(event->globalPos())) { - close(); // click outside closes tab + close(true); // click outside closes tab return true; } // fall through @@ -1479,6 +1479,12 @@ void TabBox::close(bool abort) { + if (abort) { + const auto clientList = currentClientList(); + if (clientList.size()) { + workspace()->activateClient(clientList.at(0)); + } + } if (isGrabbed()) { removeTabBoxGrab(); }