From c3882bb83240b602277f2d22f21d71690531f62e Mon Sep 17 00:00:00 2001 From: Vaxry <43317083+vaxerski@users.noreply.github.com> Date: Sat, 9 Mar 2024 16:52:59 +0000 Subject: internal: Support libhyprcursor (#5009) woo --------- Co-authored-by: Mihai Fufezan --- src/events/Misc.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/events/Misc.cpp') diff --git a/src/events/Misc.cpp b/src/events/Misc.cpp index 64f2f29d..d7e3a849 100644 --- a/src/events/Misc.cpp +++ b/src/events/Misc.cpp @@ -4,6 +4,7 @@ #include "../helpers/WLClasses.hpp" #include "../managers/input/InputManager.hpp" #include "../render/Renderer.hpp" +#include "../managers/CursorManager.hpp" // ------------------------------ // // __ __ _____ _____ _____ // @@ -69,10 +70,10 @@ void Events::listener_readyXWayland(wl_listener* listener, void* data) { wlr_xwayland_set_seat(g_pXWaylandManager->m_sWLRXWayland, g_pCompositor->m_sSeat.seat); - const auto XCURSOR = wlr_xcursor_manager_get_xcursor(g_pCompositor->m_sWLRXCursorMgr, "left_ptr", 1); - if (XCURSOR) { - wlr_xwayland_set_cursor(g_pXWaylandManager->m_sWLRXWayland, XCURSOR->images[0]->buffer, XCURSOR->images[0]->width * 4, XCURSOR->images[0]->width, - XCURSOR->images[0]->height, XCURSOR->images[0]->hotspot_x, XCURSOR->images[0]->hotspot_y); + const auto CURSOR = g_pCursorManager->dataFor("left_ptr"); + if (CURSOR.surface) { + wlr_xwayland_set_cursor(g_pXWaylandManager->m_sWLRXWayland, cairo_image_surface_get_data(CURSOR.surface), cairo_image_surface_get_stride(CURSOR.surface), CURSOR.size, + CURSOR.size, CURSOR.hotspotX, CURSOR.hotspotY); } const auto ROOT = xcb_setup_roots_iterator(xcb_get_setup(XCBCONNECTION)).data->root; -- cgit v1.2.3