diff options
author | vaxerski <[email protected]> | 2023-08-03 18:44:07 +0200 |
---|---|---|
committer | vaxerski <[email protected]> | 2023-08-03 18:44:07 +0200 |
commit | 7a2027d1fd5d447a6e0f8af8b7d2f8c2e82da7c4 (patch) | |
tree | 21b6a8b7c02c6598eaa514cbd5e3f4eb21d5e1e3 | |
parent | 9654749244117f7f150c6f2a2ce4dede6e8cbb25 (diff) | |
download | Hyprland-7a2027d1fd5d447a6e0f8af8b7d2f8c2e82da7c4.tar.gz Hyprland-7a2027d1fd5d447a6e0f8af8b7d2f8c2e82da7c4.zip |
input: fix and unify client checking in mouseRequests
-rw-r--r-- | src/managers/input/InputManager.cpp | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp index ca659d6a..1df5acb3 100644 --- a/src/managers/input/InputManager.cpp +++ b/src/managers/input/InputManager.cpp @@ -470,7 +470,7 @@ void CInputManager::processMouseRequest(wlr_seat_pointer_request_set_cursor_even else g_pHyprRenderer->m_bWindowRequestedCursorHide = false; - if (!cursorImageUnlocked()) + if (!cursorImageUnlocked() || !g_pHyprRenderer->shouldRenderCursor()) return; // cursorSurfaceInfo.pSurface = e->surface; @@ -487,18 +487,11 @@ void CInputManager::processMouseRequest(wlr_seat_pointer_request_set_cursor_even } void CInputManager::processMouseRequest(wlr_cursor_shape_manager_v1_request_set_shape_event* e) { - if (!g_pHyprRenderer->shouldRenderCursor()) - return; - - if (!g_pCompositor->m_pLastFocus) + if (!g_pHyprRenderer->shouldRenderCursor() || !cursorImageUnlocked()) return; - if (wl_resource_get_client(g_pCompositor->m_pLastFocus->resource) != e->seat_client->client) { - Debug::log(ERR, "Disallowing cursor shape request from unfocused"); - return; - } - - wlr_cursor_set_xcursor(g_pCompositor->m_sWLRCursor, g_pCompositor->m_sWLRXCursorMgr, wlr_cursor_shape_v1_name(e->shape)); + if (e->seat_client == g_pCompositor->m_sSeat.seat->pointer_state.focused_client) + wlr_cursor_set_xcursor(g_pCompositor->m_sWLRCursor, g_pCompositor->m_sWLRXCursorMgr, wlr_cursor_shape_v1_name(e->shape)); } bool CInputManager::cursorImageUnlocked() { |