diff options
author | Vaxry <[email protected]> | 2023-11-02 21:36:16 +0000 |
---|---|---|
committer | Vaxry <[email protected]> | 2023-11-02 21:36:16 +0000 |
commit | ba9e7814b0e02be251ff6172d644de59cf0170de (patch) | |
tree | d1753f7402ed73ac101bbf89de0947137a42eee4 | |
parent | f10996b5753bfc854b019f6889d6bc0c91961e3f (diff) | |
download | Hyprland-ba9e7814b0e02be251ff6172d644de59cf0170de.tar.gz Hyprland-ba9e7814b0e02be251ff6172d644de59cf0170de.zip |
input: simulate movement only if mouse is over in open/close window
fixes #3726
-rw-r--r-- | src/events/Windows.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/events/Windows.cpp b/src/events/Windows.cpp index e2ff6cc0..ce65fa72 100644 --- a/src/events/Windows.cpp +++ b/src/events/Windows.cpp @@ -649,7 +649,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(); + if (g_pCompositor->vectorToWindowIdeal(g_pInputManager->getMouseCoordsInternal()) == g_pCompositor->m_pLastWindow) + g_pInputManager->simulateMouseMovement(); } void Events::listener_unmapWindow(void* owner, void* data) { @@ -740,7 +741,8 @@ void Events::listener_unmapWindow(void* owner, void* data) { if (PWINDOWCANDIDATE != g_pCompositor->m_pLastWindow && PWINDOWCANDIDATE) g_pCompositor->focusWindow(PWINDOWCANDIDATE); - g_pInputManager->simulateMouseMovement(); + if (g_pCompositor->vectorToWindowIdeal(g_pInputManager->getMouseCoordsInternal()) == 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) { |