mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-04 22:22:00 -07:00
@@ -117,16 +117,16 @@ 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)
|
||||
// try with '_' first (old hc, etc)
|
||||
std::string newName = name;
|
||||
std::replace(newName.begin(), newName.end(), '_', '-');
|
||||
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"};
|
||||
constexpr const std::array<const char*, 3> fallbackShapes = {"default", "left_ptr", "left-ptr"};
|
||||
|
||||
for (auto& s : fallbackShapes) {
|
||||
m_sCurrentCursorShapeData = m_pHyprcursor->getShape(s, m_sCurrentStyleInfo);
|
||||
|
Reference in New Issue
Block a user