input: avoid reassigns of unchanged surfaces in processMouseRequest

This commit is contained in:
Vaxry 2024-02-12 20:01:50 +00:00
parent f33d73b9cf
commit 890307532c

View file

@ -487,10 +487,15 @@ void CInputManager::processMouseRequest(wlr_seat_pointer_request_set_cursor_even
return; return;
if (e->seat_client == g_pCompositor->m_sSeat.seat->pointer_state.focused_client) { if (e->seat_client == g_pCompositor->m_sSeat.seat->pointer_state.focused_client) {
if (e->surface != m_sCursorSurfaceInfo.wlSurface.wlr()) {
m_sCursorSurfaceInfo.wlSurface.unassign(); m_sCursorSurfaceInfo.wlSurface.unassign();
if (e->surface) { if (e->surface)
m_sCursorSurfaceInfo.wlSurface.assign(e->surface); m_sCursorSurfaceInfo.wlSurface.assign(e->surface);
}
if (e->surface) {
m_sCursorSurfaceInfo.vHotspot = {e->hotspot_x, e->hotspot_y}; m_sCursorSurfaceInfo.vHotspot = {e->hotspot_x, e->hotspot_y};
m_sCursorSurfaceInfo.hidden = false; m_sCursorSurfaceInfo.hidden = false;
} else { } else {