diff options
author | vaxerski <[email protected]> | 2023-03-20 01:50:46 +0000 |
---|---|---|
committer | vaxerski <[email protected]> | 2023-03-20 01:50:46 +0000 |
commit | d23bbd1687a5413fb7f2c08b67692d4e64f8efef (patch) | |
tree | 00f5fb8199f8492bdaab0da8405f7413db55b3c2 | |
parent | 7a514f41a34f01246eff9a21fc96fe5e89775f11 (diff) | |
download | Hyprland-d23bbd1687a5413fb7f2c08b67692d4e64f8efef.tar.gz Hyprland-d23bbd1687a5413fb7f2c08b67692d4e64f8efef.zip |
workspaces: preserve pin on moves
-rw-r--r-- | src/Compositor.cpp | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/src/Compositor.cpp b/src/Compositor.cpp index d2d84f9d..e4040f01 100644 --- a/src/Compositor.cpp +++ b/src/Compositor.cpp @@ -1715,6 +1715,11 @@ void CCompositor::swapActiveWorkspaces(CMonitor* pMonitorA, CMonitor* pMonitorB) for (auto& w : m_vWindows) { if (w->m_iWorkspaceID == PWORKSPACEA->m_iID) { + if (w->m_bPinned) { + w->m_iWorkspaceID = PWORKSPACEB->m_iID; + continue; + } + w->m_iMonitorID = pMonitorB->ID; // additionally, move floating and fs windows manually @@ -1735,6 +1740,11 @@ void CCompositor::swapActiveWorkspaces(CMonitor* pMonitorA, CMonitor* pMonitorB) for (auto& w : m_vWindows) { if (w->m_iWorkspaceID == PWORKSPACEB->m_iID) { + if (w->m_bPinned) { + w->m_iWorkspaceID = PWORKSPACEA->m_iID; + continue; + } + w->m_iMonitorID = pMonitorA->ID; // additionally, move floating and fs windows manually @@ -1750,17 +1760,6 @@ void CCompositor::swapActiveWorkspaces(CMonitor* pMonitorA, CMonitor* pMonitorB) } } - // fix pinned windows - for (auto& w : g_pCompositor->m_vWindows) { - if (w->m_iWorkspaceID == pMonitorA->activeWorkspace && w->m_bPinned) { - w->m_iWorkspaceID = PWORKSPACEB->m_iID; - } - - if (w->m_iWorkspaceID == pMonitorB->activeWorkspace && w->m_bPinned) { - w->m_iWorkspaceID = PWORKSPACEA->m_iID; - } - } - pMonitorA->activeWorkspace = PWORKSPACEB->m_iID; pMonitorB->activeWorkspace = PWORKSPACEA->m_iID; @@ -1910,6 +1909,11 @@ void CCompositor::moveWorkspaceToMonitor(CWorkspace* pWorkspace, CMonitor* pMoni for (auto& w : m_vWindows) { if (w->m_iWorkspaceID == pWorkspace->m_iID) { + if (w->m_bPinned) { + w->m_iWorkspaceID = nextWorkspaceOnMonitorID; + continue; + } + w->m_iMonitorID = pMonitor->ID; // additionally, move floating and fs windows manually |