diff options
| author | thejch <66577496+thejch@users.noreply.github.com> | 2023-10-20 10:01:04 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-10-20 18:01:04 +0100 |
| commit | bab2f6a664a67dfd0c2f442dbc0134ef7c6e07e2 (patch) | |
| tree | 8139238dcfb8b52f6ba9b51aad8f9edd1bb29e2d /src/layout/MasterLayout.cpp | |
| parent | bb9d0aed5bd11879f5a532e26fc0a91d1a8af714 (diff) | |
master: fix movewindow across monitors (#3628)
Diffstat (limited to 'src/layout/MasterLayout.cpp')
| -rw-r--r-- | src/layout/MasterLayout.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/layout/MasterLayout.cpp b/src/layout/MasterLayout.cpp index f44e04e3..ebbcc805 100644 --- a/src/layout/MasterLayout.cpp +++ b/src/layout/MasterLayout.cpp @@ -928,7 +928,16 @@ void CHyprMasterLayout::moveWindowTo(CWindow* pWindow, const std::string& dir) { const auto PWINDOW2 = g_pCompositor->getWindowInDirection(pWindow, dir[0]); - switchWindows(pWindow, PWINDOW2); + if (pWindow->m_iWorkspaceID != PWINDOW2->m_iWorkspaceID) { + // if different monitors, send to monitor + onWindowRemovedTiling(pWindow); + pWindow->moveToWorkspace(PWINDOW2->m_iWorkspaceID); + pWindow->m_iMonitorID = PWINDOW2->m_iMonitorID; + onWindowCreatedTiling(pWindow); + } else { + // if same monitor, switch windows + switchWindows(pWindow, PWINDOW2); + } } void CHyprMasterLayout::switchWindows(CWindow* pWindow, CWindow* pWindow2) { |
