aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorvaxerski <[email protected]>2023-02-06 13:16:54 +0000
committervaxerski <[email protected]>2023-02-06 13:16:59 +0000
commit863812a0979646fbc1a51b6593fa25fbad77a7be (patch)
tree2e52cc6d943a8f29b5ddec3aefe08ab120348fb0
parent4a5c3c4861fb503c7ecb6dcfc86aeb547aa3fb7f (diff)
downloadHyprland-863812a0979646fbc1a51b6593fa25fbad77a7be.tar.gz
Hyprland-863812a0979646fbc1a51b6593fa25fbad77a7be.zip
added activewindowv2
-rw-r--r--src/Compositor.cpp3
-rw-r--r--src/events/Windows.cpp4
2 files changed, 6 insertions, 1 deletions
diff --git a/src/Compositor.cpp b/src/Compositor.cpp
index 68b45df9..68070c2e 100644
--- a/src/Compositor.cpp
+++ b/src/Compositor.cpp
@@ -794,6 +794,7 @@ void CCompositor::focusWindow(CWindow* pWindow, wlr_surface* pSurface) {
wlr_seat_keyboard_notify_clear_focus(m_sSeat.seat);
g_pEventManager->postEvent(SHyprIPCEvent{"activewindow", ","});
+ g_pEventManager->postEvent(SHyprIPCEvent{"activewindowv2", ","});
g_pLayoutManager->getCurrentLayout()->onWindowFocusChange(nullptr);
@@ -864,6 +865,7 @@ void CCompositor::focusWindow(CWindow* pWindow, wlr_surface* pSurface) {
// Send an event
g_pEventManager->postEvent(SHyprIPCEvent{"activewindow", g_pXWaylandManager->getAppIDClass(pWindow) + "," + pWindow->m_szTitle});
+ g_pEventManager->postEvent(SHyprIPCEvent{"activewindowv2", getFormat("%x", pWindow)});
g_pLayoutManager->getCurrentLayout()->onWindowFocusChange(pWindow);
@@ -901,6 +903,7 @@ void CCompositor::focusSurface(wlr_surface* pSurface, CWindow* pWindowOwner) {
if (!pSurface) {
wlr_seat_keyboard_clear_focus(m_sSeat.seat);
g_pEventManager->postEvent(SHyprIPCEvent{"activewindow", ","}); // unfocused
+ g_pEventManager->postEvent(SHyprIPCEvent{"activewindowv2", ","});
g_pInputManager->m_sIMERelay.onKeyboardFocus(nullptr);
g_pCompositor->m_pLastFocus = nullptr;
return;
diff --git a/src/events/Windows.cpp b/src/events/Windows.cpp
index 3f57deda..6a7efc88 100644
--- a/src/events/Windows.cpp
+++ b/src/events/Windows.cpp
@@ -741,8 +741,10 @@ void Events::listener_setTitleWindow(void* owner, void* data) {
PWINDOW->m_szTitle = g_pXWaylandManager->getTitle(PWINDOW);
- if (PWINDOW == g_pCompositor->m_pLastWindow) // if it's the active, let's post an event to update others
+ if (PWINDOW == g_pCompositor->m_pLastWindow) { // if it's the active, let's post an event to update others
g_pEventManager->postEvent(SHyprIPCEvent{"activewindow", g_pXWaylandManager->getAppIDClass(PWINDOW) + "," + PWINDOW->m_szTitle});
+ g_pEventManager->postEvent(SHyprIPCEvent{"activewindowv2", getFormat("%x", PWINDOW)});
+ }
PWINDOW->updateDynamicRules();
g_pCompositor->updateWindowAnimatedDecorationValues(PWINDOW);