fix workspace event and add activewindow and activemon

This commit is contained in:
vaxerski 2022-05-24 22:21:31 +02:00
parent ad7e66adaa
commit 0ad33742e1
3 changed files with 8 additions and 5 deletions

View file

@ -453,6 +453,9 @@ void CCompositor::focusWindow(CWindow* pWindow, wlr_surface* pSurface) {
pWindow->m_cRealBorderColor = RENDERDATA.borderColor; pWindow->m_cRealBorderColor = RENDERDATA.borderColor;
else else
pWindow->m_cRealBorderColor = CColor(g_pConfigManager->getInt("general:col.active_border")); pWindow->m_cRealBorderColor = CColor(g_pConfigManager->getInt("general:col.active_border"));
// Send an event
g_pEventManager->postEvent(SHyprIPCEvent("activewindow", pWindow->m_szTitle));
} }
void CCompositor::focusSurface(wlr_surface* pSurface, CWindow* pWindowOwner) { void CCompositor::focusSurface(wlr_surface* pSurface, CWindow* pWindowOwner) {

View file

@ -91,7 +91,7 @@ void CInputManager::mouseMoveUnified(uint32_t time, bool refocus) {
wlr_ext_workspace_handle_v1_set_active(g_pCompositor->getWorkspaceByID(PMONITOR->activeWorkspace)->m_pWlrHandle, true); wlr_ext_workspace_handle_v1_set_active(g_pCompositor->getWorkspaceByID(PMONITOR->activeWorkspace)->m_pWlrHandle, true);
// event // event
g_pEventManager->postEvent(SHyprIPCEvent("workspace", g_pCompositor->getWorkspaceByID(PMONITOR->activeWorkspace)->m_szName)); g_pEventManager->postEvent(SHyprIPCEvent("activemon", PMONITOR->szName + "," + g_pCompositor->getWorkspaceByID(PMONITOR->activeWorkspace)->m_szName));
} }
Vector2D surfaceCoords; Vector2D surfaceCoords;

View file

@ -208,6 +208,10 @@ void CKeybindManager::changeworkspace(std::string args) {
// start anim on new workspace // start anim on new workspace
PWORKSPACETOCHANGETO->startAnim(true, ANIMTOLEFT); PWORKSPACETOCHANGETO->startAnim(true, ANIMTOLEFT);
// Event ONLY if workspace is actually "changed" and we arent just focusing
if (!m_bSuppressWorkspaceChangeEvents)
g_pEventManager->postEvent(SHyprIPCEvent("workspace", PWORKSPACETOCHANGETO->m_szName));
} }
@ -232,10 +236,6 @@ void CKeybindManager::changeworkspace(std::string args) {
// mark the monitor dirty // mark the monitor dirty
g_pHyprRenderer->damageMonitor(PMONITOR); g_pHyprRenderer->damageMonitor(PMONITOR);
// Event
if (!m_bSuppressWorkspaceChangeEvents)
g_pEventManager->postEvent(SHyprIPCEvent("workspace", PWORKSPACETOCHANGETO->m_szName));
return; return;
} }