summaryrefslogtreecommitdiff
path: root/src/managers/XCursorManager.cpp
diff options
context:
space:
mode:
authorIkalco <73481042+ikalco@users.noreply.github.com>2024-08-15 06:37:56 -0500
committerGitHub <noreply@github.com>2024-08-15 12:37:56 +0100
commitd85ae306c5746c6ebeac74c2a7a520bb3f05a119 (patch)
tree5556177a2195648a63ca8294d27c3cf67a6396ff /src/managers/XCursorManager.cpp
parent197f8807900afc81c1c92ad17e621d1998ee268b (diff)
xcursor: handle file errors when loading xcursor themes (#7326)
Diffstat (limited to 'src/managers/XCursorManager.cpp')
-rw-r--r--src/managers/XCursorManager.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/managers/XCursorManager.cpp b/src/managers/XCursorManager.cpp
index 3d36add5..0921bcd4 100644
--- a/src/managers/XCursorManager.cpp
+++ b/src/managers/XCursorManager.cpp
@@ -511,8 +511,11 @@ std::vector<SP<SXCursors>> CXCursorManager::loadAllFromDir(std::string const& pa
if (std::filesystem::exists(path) && std::filesystem::is_directory(path)) {
for (const auto& entry : std::filesystem::directory_iterator(path)) {
- if (!entry.is_regular_file() && !entry.is_symlink())
+ std::error_code e1, e2;
+ if ((!entry.is_regular_file(e1) && !entry.is_symlink(e2)) || e1 || e2) {
+ Debug::log(WARN, "XCursor failed to load shape {}: {}", entry.path().stem().string(), e1 ? e1.message() : e2.message());
continue;
+ }
auto const& full = entry.path().string();
using PcloseType = int (*)(FILE*);