input: fix and unify client checking in mouseRequests

This commit is contained in:
vaxerski 2023-08-03 18:44:07 +02:00
parent 9654749244
commit 7a2027d1fd

View file

@ -470,7 +470,7 @@ void CInputManager::processMouseRequest(wlr_seat_pointer_request_set_cursor_even
else else
g_pHyprRenderer->m_bWindowRequestedCursorHide = false; g_pHyprRenderer->m_bWindowRequestedCursorHide = false;
if (!cursorImageUnlocked()) if (!cursorImageUnlocked() || !g_pHyprRenderer->shouldRenderCursor())
return; return;
// cursorSurfaceInfo.pSurface = e->surface; // 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) { void CInputManager::processMouseRequest(wlr_cursor_shape_manager_v1_request_set_shape_event* e) {
if (!g_pHyprRenderer->shouldRenderCursor()) if (!g_pHyprRenderer->shouldRenderCursor() || !cursorImageUnlocked())
return; return;
if (!g_pCompositor->m_pLastFocus) if (e->seat_client == g_pCompositor->m_sSeat.seat->pointer_state.focused_client)
return; wlr_cursor_set_xcursor(g_pCompositor->m_sWLRCursor, g_pCompositor->m_sWLRXCursorMgr, wlr_cursor_shape_v1_name(e->shape));
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));
} }
bool CInputManager::cursorImageUnlocked() { bool CInputManager::cursorImageUnlocked() {