master: fix movewindow across monitors (#3628)

This commit is contained in:
thejch 2023-10-20 10:01:04 -07:00 committed by GitHub
parent bb9d0aed5b
commit bab2f6a664
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -928,8 +928,17 @@ void CHyprMasterLayout::moveWindowTo(CWindow* pWindow, const std::string& dir) {
const auto PWINDOW2 = g_pCompositor->getWindowInDirection(pWindow, dir[0]); const auto PWINDOW2 = g_pCompositor->getWindowInDirection(pWindow, dir[0]);
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); switchWindows(pWindow, PWINDOW2);
} }
}
void CHyprMasterLayout::switchWindows(CWindow* pWindow, CWindow* pWindow2) { void CHyprMasterLayout::switchWindows(CWindow* pWindow, CWindow* pWindow2) {
// windows should be valid, insallah // windows should be valid, insallah