mirror of
https://github.com/hyprwm/Hyprland
synced 2025-02-17 00:22:07 +01:00
events: fixup empty events not being sent on unmap
Ref #3506 https://github.com/hyprwm/Hyprland/issues/3506#issuecomment-1749508111
This commit is contained in:
parent
24c04a8b7c
commit
4b3efc73c5
3 changed files with 12 additions and 3 deletions
|
@ -893,6 +893,10 @@ void CCompositor::focusWindow(CWindow* pWindow, wlr_surface* pSurface) {
|
||||||
g_pLayoutManager->getCurrentLayout()->bringWindowToTop(pWindow);
|
g_pLayoutManager->getCurrentLayout()->bringWindowToTop(pWindow);
|
||||||
|
|
||||||
if (!pWindow || !windowValidMapped(pWindow)) {
|
if (!pWindow || !windowValidMapped(pWindow)) {
|
||||||
|
|
||||||
|
if (!m_pLastWindow && !pWindow)
|
||||||
|
return;
|
||||||
|
|
||||||
const auto PLASTWINDOW = m_pLastWindow;
|
const auto PLASTWINDOW = m_pLastWindow;
|
||||||
m_pLastWindow = nullptr;
|
m_pLastWindow = nullptr;
|
||||||
|
|
||||||
|
|
|
@ -737,8 +737,14 @@ void Events::listener_unmapWindow(void* owner, void* data) {
|
||||||
g_pInputManager->simulateMouseMovement();
|
g_pInputManager->simulateMouseMovement();
|
||||||
else
|
else
|
||||||
g_pCompositor->focusWindow(PWINDOWCANDIDATE);
|
g_pCompositor->focusWindow(PWINDOWCANDIDATE);
|
||||||
} else {
|
} else
|
||||||
g_pInputManager->simulateMouseMovement();
|
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 {
|
} else {
|
||||||
Debug::log(LOG, "Unmapped was not focused, ignoring a refocus.");
|
Debug::log(LOG, "Unmapped was not focused, ignoring a refocus.");
|
||||||
|
|
|
@ -314,9 +314,8 @@ void CInputManager::mouseMoveUnified(uint32_t time, bool refocus) {
|
||||||
|
|
||||||
wlr_seat_pointer_clear_focus(g_pCompositor->m_sSeat.seat);
|
wlr_seat_pointer_clear_focus(g_pCompositor->m_sSeat.seat);
|
||||||
|
|
||||||
if (refocus) { // if we are forcing a refocus, and we don't find a surface, clear the kb focus too!
|
if (refocus || !g_pCompositor->m_pLastWindow) // if we are forcing a refocus, and we don't find a surface, clear the kb focus too!
|
||||||
g_pCompositor->focusWindow(nullptr);
|
g_pCompositor->focusWindow(nullptr);
|
||||||
}
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue