From f6a6322a0345362338c820fb776440ef71080bd6 Mon Sep 17 00:00:00 2001 From: SoSeDiK Date: Wed, 10 Apr 2024 19:29:25 +0300 Subject: [PATCH] lib: Count cursor-less themes as invalid (#31) --- 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; }