From 3cef005fec6b5a5dbf843aff06059695c1fb52a4 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Wed, 1 Mar 2023 13:54:48 +0000 Subject: [PATCH] use XCURSOR_SIZE for internal cursor size --- src/Compositor.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/Compositor.cpp b/src/Compositor.cpp index 14f1eba1..65c893d8 100644 --- a/src/Compositor.cpp +++ b/src/Compositor.cpp @@ -142,12 +142,18 @@ CCompositor::CCompositor() { m_sWLRCursor = wlr_cursor_create(); wlr_cursor_attach_output_layout(m_sWLRCursor, m_sWLROutputLayout); - m_sWLRXCursorMgr = wlr_xcursor_manager_create(nullptr, 24); - wlr_xcursor_manager_load(m_sWLRXCursorMgr, 1); - if (const auto XCURSORENV = getenv("XCURSOR_SIZE"); !XCURSORENV || std::string(XCURSORENV).empty()) setenv("XCURSOR_SIZE", "24", true); + const auto XCURSORENV = getenv("XCURSOR_SIZE"); + int cursorSize = 24; + try { + cursorSize = std::stoi(XCURSORENV); + } catch (std::exception& e) { Debug::log(ERR, "XCURSOR_SIZE invalid in check #2? (%s)", XCURSORENV); } + + m_sWLRXCursorMgr = wlr_xcursor_manager_create(nullptr, cursorSize); + wlr_xcursor_manager_load(m_sWLRXCursorMgr, 1); + m_sSeat.seat = wlr_seat_create(m_sWLDisplay, "seat0"); m_sWLRPresentation = wlr_presentation_create(m_sWLDisplay, m_sWLRBackend);