mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-02 12:26:00 +01:00
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.
This commit is contained in:
parent
d0229d6e1e
commit
8427824719
1 changed files with 8 additions and 0 deletions
|
@ -116,6 +116,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"};
|
||||
|
|
Loading…
Reference in a new issue