mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-05 06:31:57 -07:00
unify setting of the active monitor
This commit is contained in:
@@ -1874,7 +1874,7 @@ void CCompositor::warpCursorTo(const Vector2D& pos) {
|
||||
|
||||
const auto PMONITORNEW = getMonitorFromVector(pos);
|
||||
if (PMONITORNEW != m_pLastMonitor)
|
||||
m_pLastMonitor = PMONITORNEW;
|
||||
setActiveMonitor(PMONITORNEW);
|
||||
}
|
||||
|
||||
SLayerSurface* CCompositor::getLayerSurfaceFromWlr(wlr_layer_surface_v1* pLS) {
|
||||
@@ -1987,3 +1987,13 @@ CWorkspace* CCompositor::createNewWorkspace(const int& id, const int& monid, con
|
||||
|
||||
return PWORKSPACE;
|
||||
}
|
||||
|
||||
void CCompositor::setActiveMonitor(CMonitor* pMonitor) {
|
||||
if (m_pLastMonitor == pMonitor)
|
||||
return;
|
||||
|
||||
const auto PWORKSPACE = getWorkspaceByID(pMonitor->activeWorkspace);
|
||||
|
||||
g_pEventManager->postEvent(SHyprIPCEvent{"focusedmon", pMonitor->szName + "," + PWORKSPACE->m_szName});
|
||||
m_pLastMonitor = pMonitor;
|
||||
}
|
||||
|
Reference in New Issue
Block a user