diff options
author | Vaxry <[email protected]> | 2023-03-20 02:01:23 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2023-03-20 02:01:23 +0000 |
commit | 200fa3d677cde939ca2f4d7165458f07345d1cfc (patch) | |
tree | 75d379197fc96200a6ce187ebb62a48301559a3e /src/Compositor.cpp | |
parent | dcae72e153e915ad8b4355f6f981aed15b6766d4 (diff) | |
parent | d23bbd1687a5413fb7f2c08b67692d4e64f8efef (diff) | |
download | Hyprland-200fa3d677cde939ca2f4d7165458f07345d1cfc.tar.gz Hyprland-200fa3d677cde939ca2f4d7165458f07345d1cfc.zip |
Merge branch 'main' into wrap-surfaces
Diffstat (limited to 'src/Compositor.cpp')
-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 497f26d8..924de252 100644 --- a/src/Compositor.cpp +++ b/src/Compositor.cpp @@ -1714,6 +1714,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 @@ -1734,6 +1739,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 @@ -1749,17 +1759,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; @@ -1909,6 +1908,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 |