summaryrefslogtreecommitdiff
path: root/src/events/Windows.cpp
diff options
context:
space:
mode:
authorvaxerski <43317083+vaxerski@users.noreply.github.com>2023-10-06 01:11:47 +0100
committervaxerski <43317083+vaxerski@users.noreply.github.com>2023-10-06 01:11:47 +0100
commit4b3efc73c5d059e828f79952d80ff79c97521c3d (patch)
treea9559258388a6926b1352d223f5af75faee69d68 /src/events/Windows.cpp
parent24c04a8b7c874ead168bb2418f4325cb8bdaca5b (diff)
events: fixup empty events not being sent on unmap
Ref #3506 https://github.com/hyprwm/Hyprland/issues/3506#issuecomment-1749508111
Diffstat (limited to 'src/events/Windows.cpp')
-rw-r--r--src/events/Windows.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/events/Windows.cpp b/src/events/Windows.cpp
index 54ffb37e..f78a2975 100644
--- a/src/events/Windows.cpp
+++ b/src/events/Windows.cpp
@@ -737,8 +737,14 @@ void Events::listener_unmapWindow(void* owner, void* data) {
g_pInputManager->simulateMouseMovement();
else
g_pCompositor->focusWindow(PWINDOWCANDIDATE);
- } else {
+ } else
g_pInputManager->simulateMouseMovement();
+
+ // CWindow::onUnmap will remove this window's active status, but we can't really do it above.
+ if (PWINDOW == g_pCompositor->m_pLastWindow || !g_pCompositor->m_pLastWindow) {
+ g_pEventManager->postEvent(SHyprIPCEvent{"activewindow", ","});
+ g_pEventManager->postEvent(SHyprIPCEvent{"activewindowv2", ","});
+ EMIT_HOOK_EVENT("activeWindow", (CWindow*)nullptr);
}
} else {
Debug::log(LOG, "Unmapped was not focused, ignoring a refocus.");