diff options
| author | Vaxry <43317083+vaxerski@users.noreply.github.com> | 2024-03-09 16:52:59 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-03-09 16:52:59 +0000 |
| commit | c3882bb83240b602277f2d22f21d71690531f62e (patch) | |
| tree | c5e9a1110cd5d22ef700fd8b7408a418cba7c4f0 /src/events/Misc.cpp | |
| parent | e7a5db4852d654596e554b9cdeaa2694b346ee03 (diff) | |
internal: Support libhyprcursor (#5009)
woo
---------
Co-authored-by: Mihai Fufezan <fufexan@protonmail.com>
Diffstat (limited to 'src/events/Misc.cpp')
| -rw-r--r-- | src/events/Misc.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
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; |
