summaryrefslogtreecommitdiff
path: root/src/layout/IHyprLayout.cpp
diff options
context:
space:
mode:
authordranull <150595692+dranull@users.noreply.github.com>2023-12-29 23:38:12 +0000
committerGitHub <noreply@github.com>2023-12-30 00:38:12 +0100
commit5f8e4068e51480791dbccbe48e86910e9b3cc881 (patch)
treea3df348e7e1aa33237295504b17f63239cfda61a /src/layout/IHyprLayout.cpp
parent78f9ba9fdd7e258747b862ca2ae7d4cf5335f4ed (diff)
groupbar: Middle click on groupbar to close tab (#4297)
* Prevent window swapping when the head is removed * Bring floating windows to top when selected * Allow clicks on gropubar in fullscreen 1 * Close window on groupbar with middle click
Diffstat (limited to 'src/layout/IHyprLayout.cpp')
-rw-r--r--src/layout/IHyprLayout.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/layout/IHyprLayout.cpp b/src/layout/IHyprLayout.cpp
index 76f1e796..6a03ac80 100644
--- a/src/layout/IHyprLayout.cpp
+++ b/src/layout/IHyprLayout.cpp
@@ -36,15 +36,15 @@ void IHyprLayout::onWindowRemoved(CWindow* pWindow) {
const auto WINDOWISVISIBLE = pWindow->getGroupCurrent() == pWindow;
if (WINDOWISVISIBLE)
- PWINDOWPREV->setGroupCurrent(PWINDOWPREV);
+ PWINDOWPREV->setGroupCurrent(pWindow->m_sGroupData.head ? pWindow->m_sGroupData.pNextWindow : PWINDOWPREV);
PWINDOWPREV->m_sGroupData.pNextWindow = pWindow->m_sGroupData.pNextWindow;
pWindow->m_sGroupData.pNextWindow = nullptr;
if (pWindow->m_sGroupData.head) {
- std::swap(PWINDOWPREV->m_sGroupData.head, pWindow->m_sGroupData.head);
- std::swap(PWINDOWPREV->m_sGroupData.locked, pWindow->m_sGroupData.locked);
+ std::swap(PWINDOWPREV->m_sGroupData.pNextWindow->m_sGroupData.head, pWindow->m_sGroupData.head);
+ std::swap(PWINDOWPREV->m_sGroupData.pNextWindow->m_sGroupData.locked, pWindow->m_sGroupData.locked);
}
if (pWindow == m_pLastTiledWindow)