diff options
| author | Vaxry <vaxry@vaxry.net> | 2024-05-02 14:47:05 +0100 |
|---|---|---|
| committer | Vaxry <vaxry@vaxry.net> | 2024-05-02 14:47:10 +0100 |
| commit | 84278247194fd04e042821fd171be5ee59b0a8d0 (patch) | |
| tree | efcfb02730c6ffa0db5954dcfb5f062263c8f95c /src/managers/CursorManager.cpp | |
| parent | d0229d6e1ec8f3047c57c7e641ae87e0271f5874 (diff) | |
cursormgr: attempt using - instead of _ for failed cursors before fallback
web uses -, and thus some themes might use - too. Attempt replacing _ with - before assuming a shape is missing.
Diffstat (limited to 'src/managers/CursorManager.cpp')
| -rw-r--r-- | src/managers/CursorManager.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/managers/CursorManager.cpp b/src/managers/CursorManager.cpp index 51f012b4..c7e47120 100644 --- a/src/managers/CursorManager.cpp +++ b/src/managers/CursorManager.cpp @@ -117,6 +117,14 @@ void CCursorManager::setCursorFromName(const std::string& name) { m_sCurrentCursorShapeData = m_pHyprcursor->getShape(name.c_str(), m_sCurrentStyleInfo); if (m_sCurrentCursorShapeData.images.size() < 1) { + // try with '-' first (xcursor, web, etc) + std::string newName = name; + std::replace(newName.begin(), newName.end(), '_', '-'); + + m_sCurrentCursorShapeData = m_pHyprcursor->getShape(newName.c_str(), m_sCurrentStyleInfo); + } + + if (m_sCurrentCursorShapeData.images.size() < 1) { // fallback to a default if available constexpr const std::array<const char*, 2> fallbackShapes = {"default", "left_ptr"}; |
