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/Compositor.cpp | |
| parent | e7a5db4852d654596e554b9cdeaa2694b346ee03 (diff) | |
internal: Support libhyprcursor (#5009)
woo
---------
Co-authored-by: Mihai Fufezan <fufexan@protonmail.com>
Diffstat (limited to 'src/Compositor.cpp')
| -rw-r--r-- | src/Compositor.cpp | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/src/Compositor.cpp b/src/Compositor.cpp index 9d5f7241..5697adbf 100644 --- a/src/Compositor.cpp +++ b/src/Compositor.cpp @@ -1,6 +1,7 @@ #include "Compositor.hpp" #include "helpers/Splashes.hpp" #include "config/ConfigValue.hpp" +#include "managers/CursorManager.hpp" #include <random> #include <unordered_set> #include "debug/HyprCtl.hpp" @@ -182,18 +183,6 @@ void CCompositor::initServer() { m_sWLRCursor = wlr_cursor_create(); wlr_cursor_attach_output_layout(m_sWLRCursor, m_sWLROutputLayout); - 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? ({})", 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); @@ -422,6 +411,7 @@ void CCompositor::cleanup() { wl_display_destroy_clients(g_pCompositor->m_sWLDisplay); g_pDecorationPositioner.reset(); + g_pCursorManager.reset(); g_pPluginSystem.reset(); g_pHyprNotificationOverlay.reset(); g_pDebugOverlay.reset(); @@ -511,6 +501,9 @@ void CCompositor::initManagers(eManagersInitStage stage) { Debug::log(LOG, "Creating the DecorationPositioner!"); g_pDecorationPositioner = std::make_unique<CDecorationPositioner>(); + + Debug::log(LOG, "Creating the CursorManager!"); + g_pCursorManager = std::make_unique<CCursorManager>(); } break; default: UNREACHABLE(); } |
