aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorVaxry <[email protected]>2024-02-12 20:01:50 +0000
committerVaxry <[email protected]>2024-02-12 20:02:00 +0000
commit890307532caa3369ea089b606b7786ccce4b8504 (patch)
treef1ea2bd190cb80592e315df4dd523e4801465260
parentf33d73b9cf102d5de7bcc29721ec4f8fc7c0d66d (diff)
downloadHyprland-890307532caa3369ea089b606b7786ccce4b8504.tar.gz
Hyprland-890307532caa3369ea089b606b7786ccce4b8504.zip
input: avoid reassigns of unchanged surfaces in processMouseRequest
-rw-r--r--src/managers/input/InputManager.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp
index 9f713b03..b36b0034 100644
--- a/src/managers/input/InputManager.cpp
+++ b/src/managers/input/InputManager.cpp
@@ -487,10 +487,15 @@ void CInputManager::processMouseRequest(wlr_seat_pointer_request_set_cursor_even
return;
if (e->seat_client == g_pCompositor->m_sSeat.seat->pointer_state.focused_client) {
- m_sCursorSurfaceInfo.wlSurface.unassign();
+
+ if (e->surface != m_sCursorSurfaceInfo.wlSurface.wlr()) {
+ m_sCursorSurfaceInfo.wlSurface.unassign();
+
+ if (e->surface)
+ m_sCursorSurfaceInfo.wlSurface.assign(e->surface);
+ }
if (e->surface) {
- m_sCursorSurfaceInfo.wlSurface.assign(e->surface);
m_sCursorSurfaceInfo.vHotspot = {e->hotspot_x, e->hotspot_y};
m_sCursorSurfaceInfo.hidden = false;
} else {