From 6b4131ee523bf2cf863c1e3366da54f40cd77474 Mon Sep 17 00:00:00 2001 From: Vaxry Date: Mon, 30 Sep 2024 18:12:15 +0100 Subject: [PATCH] core: initialize C shape data fully --- libhyprcursor/VarList.cpp | 3 +-- libhyprcursor/hyprcursor.cpp | 6 ++++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/libhyprcursor/VarList.cpp b/libhyprcursor/VarList.cpp index 518acde..4a81de0 100644 --- a/libhyprcursor/VarList.cpp +++ b/libhyprcursor/VarList.cpp @@ -28,8 +28,7 @@ CVarList::CVarList(const std::string& in, const size_t lastArgNo, const char del std::string args{in}; size_t idx = 0; size_t pos = 0; - std::ranges::replace_if( - args, [&](const char& c) { return delim == 's' ? std::isspace(c) : c == delim; }, 0); + std::ranges::replace_if(args, [&](const char& c) { return delim == 's' ? std::isspace(c) : c == delim; }, 0); for (const auto& s : args | std::views::split(0)) { if (removeEmpty && s.empty()) diff --git a/libhyprcursor/hyprcursor.cpp b/libhyprcursor/hyprcursor.cpp index 155c0bb..3a83a26 100644 --- a/libhyprcursor/hyprcursor.cpp +++ b/libhyprcursor/hyprcursor.cpp @@ -389,6 +389,12 @@ SCursorRawShapeDataC* CHyprcursorManager::getRawShapeDataC(const char* shape_) { SCursorRawShapeDataC* data = new SCursorRawShapeDataC; std::vector resultingImages; data->overridenBy = nullptr; + data->images = nullptr; + data->len = 0; + data->hotspotX = 0; + data->hotspotY = 0; + data->resizeAlgo = eHyprcursorResizeAlgo::HC_RESIZE_NONE; + data->type = eHyprcursorDataType::HC_DATA_PNG; for (auto& shape : impl->theme.shapes) { // if it's overridden just return the override