socket2: add focusedmonv2 event (#8921)

* socket2: add focusedmonv2 event

* socket2: remove workspace name from focusedmonv2
This commit is contained in:
davc0n 2025-01-03 23:43:48 +01:00 committed by GitHub
parent b0cd9972e8
commit f69e72eca1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2588,7 +2588,12 @@ void CCompositor::setActiveMonitor(PHLMONITOR pMonitor) {
const auto PWORKSPACE = pMonitor->activeWorkspace;
g_pEventManager->postEvent(SHyprIPCEvent{"focusedmon", pMonitor->szName + "," + (PWORKSPACE ? PWORKSPACE->m_szName : "?")});
const auto WORKSPACE_ID = PWORKSPACE ? std::to_string(PWORKSPACE->m_iID) : std::to_string(WORKSPACE_INVALID);
const auto WORKSPACE_NAME = PWORKSPACE ? PWORKSPACE->m_szName : "?";
g_pEventManager->postEvent(SHyprIPCEvent{"focusedmon", pMonitor->szName + "," + WORKSPACE_NAME});
g_pEventManager->postEvent(SHyprIPCEvent{"focusedmonv2", pMonitor->szName + "," + WORKSPACE_ID});
EMIT_HOOK_EVENT("focusedMon", pMonitor);
m_pLastMonitor = pMonitor->self;
}