diff options
| author | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-09-14 17:30:16 +0200 |
|---|---|---|
| committer | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-09-14 17:30:16 +0200 |
| commit | 037d4ed422bb3bb34617f444a360a8abab6863cb (patch) | |
| tree | c6ba498a459e88df756c60fd3f9a6e78b40094fc /src/layout/MasterLayout.cpp | |
| parent | 9f82278d65ab0b0434c14c0dbbd6556a40232f36 (diff) | |
handle multi-ws swaps in layouts
Diffstat (limited to 'src/layout/MasterLayout.cpp')
| -rw-r--r-- | src/layout/MasterLayout.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/layout/MasterLayout.cpp b/src/layout/MasterLayout.cpp index 8f00db47..759c46d0 100644 --- a/src/layout/MasterLayout.cpp +++ b/src/layout/MasterLayout.cpp @@ -425,16 +425,17 @@ void CHyprMasterLayout::switchWindows(CWindow* pWindow, CWindow* pWindow2) { return; if (PNODE->workspaceID != PNODE2->workspaceID) { - Debug::log(ERR, "Master: Rejecting a swap between workspaces"); - return; + std::swap(pWindow2->m_iMonitorID, pWindow->m_iMonitorID); + std::swap(pWindow2->m_iWorkspaceID, pWindow->m_iWorkspaceID); } // massive hack: just swap window pointers, lol - const auto PWINDOW1 = PNODE->pWindow; - PNODE->pWindow = PNODE2->pWindow; - PNODE2->pWindow = PWINDOW1; + PNODE->pWindow = pWindow2; + PNODE2->pWindow = pWindow; - recalculateMonitor(PWINDOW1->m_iMonitorID); + recalculateMonitor(pWindow->m_iMonitorID); + if (PNODE2->workspaceID != PNODE->workspaceID) + recalculateMonitor(pWindow2->m_iMonitorID); } void CHyprMasterLayout::alterSplitRatioBy(CWindow* pWindow, float ratio) { |
