asyncResourceGatherer: support for home relative paths (#96)

This commit is contained in:
Maximilian Seidler 2024-03-05 15:49:52 +01:00 committed by GitHub
parent d1f542a75f
commit 738cc241e3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -5,6 +5,7 @@
#include <pango/pangocairo.h> #include <pango/pangocairo.h>
#include <algorithm> #include <algorithm>
#include "../core/hyprlock.hpp" #include "../core/hyprlock.hpp"
#include "../helpers/MiscFunctions.hpp"
std::mutex cvmtx; std::mutex cvmtx;
@ -131,9 +132,10 @@ void CAsyncResourceGatherer::gather() {
continue; 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 // 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); const auto CAIRO = cairo_create(CAIROISURFACE);
cairo_scale(CAIRO, 1, 1); cairo_scale(CAIRO, 1, 1);