cursormgr: log theme loading failures

This commit is contained in:
Vaxry 2024-03-24 19:39:56 +00:00
parent 1e82d5a04d
commit 294ff8609f

View file

@ -15,6 +15,9 @@ static int cursorAnimTimer(void* data) {
CCursorManager::CCursorManager() {
m_pHyprcursor = std::make_unique<Hyprcursor::CHyprcursorManager>(m_szTheme.empty() ? nullptr : m_szTheme.c_str());
if (!m_pHyprcursor->valid())
Debug::log(ERR, "Hyprcursor failed loading theme \"{}\", falling back to X.", m_szTheme);
// find default size. First, HYPRCURSOR_SIZE, then XCURSOR_SIZE, then 24
auto SIZE = getenv("HYPRCURSOR_SIZE");
if (SIZE) {
@ -224,6 +227,9 @@ void CCursorManager::changeTheme(const std::string& name, const int size) {
m_szTheme = name;
m_iSize = size;
if (!m_pHyprcursor->valid())
Debug::log(ERR, "Hyprcursor failed loading theme \"{}\", falling back to X.", m_szTheme);
setenv("XCURSOR_SIZE", std::to_string(m_iSize).c_str(), true);
setenv("XCURSOR_THEME", name.c_str(), true);