summaryrefslogtreecommitdiff
path: root/src/managers/input/InputManager.cpp
diff options
context:
space:
mode:
authorvaxerski <43317083+vaxerski@users.noreply.github.com>2023-01-31 00:26:15 +0000
committervaxerski <43317083+vaxerski@users.noreply.github.com>2023-01-31 00:26:15 +0000
commit11234529dbc5f85fc46df479f563c2c563afe9c2 (patch)
tree97cd16dd56dd8aa779d2961ccd31a1125674e853 /src/managers/input/InputManager.cpp
parentf90ff8303b4f2d0c39fe9e3dd35c5b0258491156 (diff)
Simulate mouse movement on unmap of popups and subsurfaces
Diffstat (limited to 'src/managers/input/InputManager.cpp')
-rw-r--r--src/managers/input/InputManager.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp
index f00b135a..e3bd9c81 100644
--- a/src/managers/input/InputManager.cpp
+++ b/src/managers/input/InputManager.cpp
@@ -35,6 +35,15 @@ void CInputManager::onMouseWarp(wlr_pointer_motion_absolute_event* e) {
m_bLastInputTouch = false;
}
+void CInputManager::simulateMouseMovement() {
+ timespec now;
+ clock_gettime(CLOCK_MONOTONIC, &now);
+ m_vLastCursorPosFloored = m_vLastCursorPosFloored - Vector2D(1, 1); // hack: force the mouseMoveUnified to report without making this a refocus.
+ mouseMoveUnified(now.tv_sec * 1000 + now.tv_nsec / 10000000);
+
+ m_tmrLastCursorMovement.reset();
+}
+
void CInputManager::mouseMoveUnified(uint32_t time, bool refocus) {
static auto* const PFOLLOWMOUSE = &g_pConfigManager->getConfigValuePtr("input:follow_mouse")->intValue;
static auto* const PMOUSEDPMS = &g_pConfigManager->getConfigValuePtr("misc:mouse_move_enables_dpms")->intValue;