aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorvaxerski <[email protected]>2022-05-24 22:21:31 +0200
committervaxerski <[email protected]>2022-05-24 22:21:31 +0200
commit0ad33742e14f73bb46acf9bad97fe963d495e025 (patch)
treebe4ab119adf336379acced540fce25ada0c50222
parentad7e66adaabb14b3c9e5287c95bcff6cbc1472a1 (diff)
downloadHyprland-0ad33742e14f73bb46acf9bad97fe963d495e025.tar.gz
Hyprland-0ad33742e14f73bb46acf9bad97fe963d495e025.zip
fix workspace event and add activewindow and activemon
-rw-r--r--src/Compositor.cpp3
-rw-r--r--src/managers/InputManager.cpp2
-rw-r--r--src/managers/KeybindManager.cpp8
3 files changed, 8 insertions, 5 deletions
diff --git a/src/Compositor.cpp b/src/Compositor.cpp
index c8376c29..868f15e0 100644
--- a/src/Compositor.cpp
+++ b/src/Compositor.cpp
@@ -453,6 +453,9 @@ void CCompositor::focusWindow(CWindow* pWindow, wlr_surface* pSurface) {
pWindow->m_cRealBorderColor = RENDERDATA.borderColor;
else
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) {
diff --git a/src/managers/InputManager.cpp b/src/managers/InputManager.cpp
index b5b8b806..e3e4bd36 100644
--- a/src/managers/InputManager.cpp
+++ b/src/managers/InputManager.cpp
@@ -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);
// 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;
diff --git a/src/managers/KeybindManager.cpp b/src/managers/KeybindManager.cpp
index d4340545..ed2be2c5 100644
--- a/src/managers/KeybindManager.cpp
+++ b/src/managers/KeybindManager.cpp
@@ -208,6 +208,10 @@ void CKeybindManager::changeworkspace(std::string args) {
// start anim on new workspace
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
g_pHyprRenderer->damageMonitor(PMONITOR);
- // Event
- if (!m_bSuppressWorkspaceChangeEvents)
- g_pEventManager->postEvent(SHyprIPCEvent("workspace", PWORKSPACETOCHANGETO->m_szName));
-
return;
}