From 2eedbedd6d81d007ce457db39d2b2ff7e8e3465b Mon Sep 17 00:00:00 2001 From: SoSeDiK Date: Wed, 10 Apr 2024 17:17:33 +0300 Subject: [PATCH] Count cursor-less themes as invalid --- include/hyprcursor/hyprcursor.hpp | 2 ++ libhyprcursor/hyprcursor.cpp | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/include/hyprcursor/hyprcursor.hpp b/include/hyprcursor/hyprcursor.hpp index 0e0f280..bf91706 100644 --- a/include/hyprcursor/hyprcursor.hpp +++ b/include/hyprcursor/hyprcursor.hpp @@ -58,6 +58,8 @@ namespace Hyprcursor { If none found, bool valid() will be false. If loading fails, bool valid() will be false. + + If theme has no valid cursor shapes, bool valid() will be false. */ class CHyprcursorManager { public: diff --git a/libhyprcursor/hyprcursor.cpp b/libhyprcursor/hyprcursor.cpp index a78d2ba..f6bd20a 100644 --- a/libhyprcursor/hyprcursor.cpp +++ b/libhyprcursor/hyprcursor.cpp @@ -248,6 +248,11 @@ void CHyprcursorManager::init(const char* themeName_) { return; } + if (impl->theme.shapes.empty()) { + Debug::log(HC_LOG_ERR, logFn, "Theme {} has no valid cursor shapes\n", impl->themeName); + return; + } + finalizedAndValid = true; }