master: change active monitor when moving windows around (#5001)

This commit is contained in:
thejch 2024-03-07 05:23:22 -08:00 committed by GitHub
parent 77161fdbef
commit bf71026b8d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -977,6 +977,8 @@ void CHyprMasterLayout::moveWindowTo(CWindow* pWindow, const std::string& dir) {
onWindowRemovedTiling(pWindow); onWindowRemovedTiling(pWindow);
pWindow->moveToWorkspace(PWINDOW2->m_iWorkspaceID); pWindow->moveToWorkspace(PWINDOW2->m_iWorkspaceID);
pWindow->m_iMonitorID = PWINDOW2->m_iMonitorID; pWindow->m_iMonitorID = PWINDOW2->m_iMonitorID;
const auto pMonitor = g_pCompositor->getMonitorFromID(pWindow->m_iMonitorID);
g_pCompositor->setActiveMonitor(pMonitor);
onWindowCreatedTiling(pWindow); onWindowCreatedTiling(pWindow);
} else { } else {
// if same monitor, switch windows // if same monitor, switch windows