From 7d7e82d446f097692e24220614951da435dcca2b Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Fri, 1 Jul 2022 17:59:11 +0200 Subject: [PATCH] only do mouseMoveUnified on pix change --- src/managers/input/InputManager.cpp | 7 +++++++ src/managers/input/InputManager.hpp | 1 + 2 files changed, 8 insertions(+) diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp index 548af552..24143833 100644 --- a/src/managers/input/InputManager.cpp +++ b/src/managers/input/InputManager.cpp @@ -37,6 +37,13 @@ void CInputManager::mouseMoveUnified(uint32_t time, bool refocus) { } Vector2D mouseCoords = getMouseCoordsInternal(); + const auto MOUSECOORDSFLOORED = mouseCoords.floor(); + + if (MOUSECOORDSFLOORED == m_vLastCursorPosFloored) + return; + + m_vLastCursorPosFloored = MOUSECOORDSFLOORED; + const auto PMONITOR = g_pCompositor->getMonitorFromCursor(); bool didConstraintOnCursor = false; diff --git a/src/managers/input/InputManager.hpp b/src/managers/input/InputManager.hpp index 5089e5e1..e28e084b 100644 --- a/src/managers/input/InputManager.hpp +++ b/src/managers/input/InputManager.hpp @@ -68,6 +68,7 @@ private: // for click behavior override eClickBehaviorMode m_ecbClickBehavior = CLICKMODE_DEFAULT; + Vector2D m_vLastCursorPosFloored = Vector2D(); void processMouseDownNormal(wlr_pointer_button_event* e); void processMouseDownKill(wlr_pointer_button_event* e);