diff options
| author | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2023-03-01 13:54:48 +0000 |
|---|---|---|
| committer | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2023-03-01 13:54:48 +0000 |
| commit | 3cef005fec6b5a5dbf843aff06059695c1fb52a4 (patch) | |
| tree | ae344f9e798ee1fac1cb3a7ecdb2ec46145d075f /src/Compositor.cpp | |
| parent | 71496a0a3c31d9e0b7ce55a21713304fc23a46cd (diff) | |
use XCURSOR_SIZE for internal cursor size
Diffstat (limited to 'src/Compositor.cpp')
| -rw-r--r-- | src/Compositor.cpp | 12 |
1 files 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); |
