Skip to content

Commit

Permalink
socket2: add focusedmonv2 event
Browse files Browse the repository at this point in the history
  • Loading branch information
davc0n committed Jan 1, 2025
1 parent 1989b00 commit 01b11d4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Compositor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2587,7 +2587,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 + "," + WORKSPACE_NAME});

EMIT_HOOK_EVENT("focusedMon", pMonitor);
m_pLastMonitor = pMonitor->self;
}
Expand Down

0 comments on commit 01b11d4

Please sign in to comment.