aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorVaxry <[email protected]>2023-11-01 19:50:32 +0000
committerVaxry <[email protected]>2023-11-01 19:50:32 +0000
commita4db48b46b9b92b5a04b1f34490cb38802942656 (patch)
tree900765ee84610548a4b4a1bb6629a6c3b944c4ec
parentc44e255194c8cc275e31e62277a8a52143e31881 (diff)
downloadHyprland-a4db48b46b9b92b5a04b1f34490cb38802942656.tar.gz
Hyprland-a4db48b46b9b92b5a04b1f34490cb38802942656.zip
input: simulate mouse movement to fix focus on open/close window
fixes #3679
-rw-r--r--src/events/Windows.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/events/Windows.cpp b/src/events/Windows.cpp
index 25b54c6c..e2ff6cc0 100644
--- a/src/events/Windows.cpp
+++ b/src/events/Windows.cpp
@@ -648,6 +648,8 @@ void Events::listener_mapWindow(void* owner, void* data) {
g_pCompositor->setPreferredScaleForSurface(PWINDOW->m_pWLSurface.wlr(), PMONITOR->scale);
g_pCompositor->setPreferredTransformForSurface(PWINDOW->m_pWLSurface.wlr(), PMONITOR->transform);
+
+ g_pInputManager->simulateMouseMovement();
}
void Events::listener_unmapWindow(void* owner, void* data) {
@@ -735,13 +737,10 @@ void Events::listener_unmapWindow(void* owner, void* data) {
Debug::log(LOG, "On closed window, new focused candidate is {}", PWINDOWCANDIDATE);
- if (PWINDOWCANDIDATE != g_pCompositor->m_pLastWindow) {
- if (!PWINDOWCANDIDATE)
- g_pInputManager->simulateMouseMovement();
- else
- g_pCompositor->focusWindow(PWINDOWCANDIDATE);
- } else
- g_pInputManager->simulateMouseMovement();
+ if (PWINDOWCANDIDATE != g_pCompositor->m_pLastWindow && PWINDOWCANDIDATE)
+ g_pCompositor->focusWindow(PWINDOWCANDIDATE);
+
+ 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) {