From f5c2dfc706776986ab9ff81a2512cc88f8aaef19 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Sun, 26 Jun 2022 13:43:32 +0200 Subject: a bit of fixes to cursor hiding --- src/events/Devices.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/events/Devices.cpp') diff --git a/src/events/Devices.cpp b/src/events/Devices.cpp index 7a47df77..df4501cf 100644 --- a/src/events/Devices.cpp +++ b/src/events/Devices.cpp @@ -56,7 +56,16 @@ void Events::listener_mouseAxis(wl_listener* listener, void* data) { void Events::listener_requestMouse(wl_listener* listener, void* data) { const auto EVENT = (wlr_seat_pointer_request_set_cursor_event*)data; + + if (!g_pHyprRenderer->shouldRenderCursor()) + return; + if (!EVENT->surface) { + g_pHyprRenderer->m_bWindowRequestedCursorHide = true; + } else { + g_pHyprRenderer->m_bWindowRequestedCursorHide = false; + } + if (EVENT->seat_client == g_pCompositor->m_sSeat.seat->pointer_state.focused_client) wlr_cursor_set_surface(g_pCompositor->m_sWLRCursor, EVENT->surface, EVENT->hotspot_x, EVENT->hotspot_y); } -- cgit v1.2.3