From 738cc241e33576e93671cceef1d9cb5ebb338792 Mon Sep 17 00:00:00 2001 From: Maximilian Seidler <78690852+PaideiaDilemma@users.noreply.github.com> Date: Tue, 5 Mar 2024 15:49:52 +0100 Subject: [PATCH] asyncResourceGatherer: support for home relative paths (#96) --- src/renderer/AsyncResourceGatherer.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/renderer/AsyncResourceGatherer.cpp b/src/renderer/AsyncResourceGatherer.cpp index 7118fa6..a99131d 100644 --- a/src/renderer/AsyncResourceGatherer.cpp +++ b/src/renderer/AsyncResourceGatherer.cpp @@ -5,6 +5,7 @@ #include #include #include "../core/hyprlock.hpp" +#include "../helpers/MiscFunctions.hpp" std::mutex cvmtx; @@ -130,10 +131,11 @@ void CAsyncResourceGatherer::gather() { if (path.empty()) continue; - std::string id = std::string{"background:"} + path; + std::string id = std::string{"background:"} + path; + const auto ABSOLUTEPATH = absolutePath(path, "").value_or(path); // preload bg img - const auto CAIROISURFACE = cairo_image_surface_create_from_png(path.c_str()); + const auto CAIROISURFACE = cairo_image_surface_create_from_png(ABSOLUTEPATH.c_str()); const auto CAIRO = cairo_create(CAIROISURFACE); cairo_scale(CAIRO, 1, 1);