From 75270a9b38ecf3241a904c2248b1380f11ee9bce Mon Sep 17 00:00:00 2001 From: vaxerski Date: Sun, 31 Dec 2023 14:06:11 +0100 Subject: [PATCH] core: fix splash options parsing --- src/Hyprpaper.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/Hyprpaper.cpp b/src/Hyprpaper.cpp index 9574caf..c3b6225 100644 --- a/src/Hyprpaper.cpp +++ b/src/Hyprpaper.cpp @@ -451,8 +451,10 @@ SPoolBuffer* CHyprpaper::getPoolBuffer(SMonitor* pMonitor, CWallpaperTarget* pWa } void CHyprpaper::renderWallpaperForMonitor(SMonitor* pMonitor) { - static auto* const PRENDERSPLASH = reinterpret_cast(g_pConfigManager->config->getConfigValuePtr("splash")); - static auto* const PSPLASHOFFSET = reinterpret_cast(g_pConfigManager->config->getConfigValuePtr("splash_offset")); + static auto* const PRENDERSPLASH = g_pConfigManager->config->getConfigValuePtr("splash"); + static auto* const PSPLASHOFFSET = g_pConfigManager->config->getConfigValuePtr("splash_offset"); + const auto RENDERSPLASH = *reinterpret_cast(PRENDERSPLASH->dataPtr()); + const auto SPLASHOFFSET = *reinterpret_cast(PSPLASHOFFSET->dataPtr()); const auto PWALLPAPERTARGET = m_mMonitorActiveWallpaperTargets[pMonitor]; const auto CONTAIN = m_mMonitorWallpaperRenderData[pMonitor->name].contain; @@ -511,7 +513,7 @@ void CHyprpaper::renderWallpaperForMonitor(SMonitor* pMonitor) { cairo_paint(PCAIRO); - if (*PRENDERSPLASH && getenv("HYPRLAND_INSTANCE_SIGNATURE")) { + if (RENDERSPLASH && getenv("HYPRLAND_INSTANCE_SIGNATURE")) { auto SPLASH = execAndGet("hyprctl splash"); SPLASH.pop_back(); @@ -527,9 +529,9 @@ void CHyprpaper::renderWallpaperForMonitor(SMonitor* pMonitor) { cairo_text_extents_t textExtents; cairo_text_extents(PCAIRO, SPLASH.c_str(), &textExtents); - cairo_move_to(PCAIRO, ((DIMENSIONS.x - textExtents.width * scale) / 2.0) / scale, ((DIMENSIONS.y * (100 - *PSPLASHOFFSET)) / 100 - textExtents.height * scale) / scale); + cairo_move_to(PCAIRO, ((DIMENSIONS.x - textExtents.width * scale) / 2.0) / scale, ((DIMENSIONS.y * (100 - SPLASHOFFSET)) / 100 - textExtents.height * scale) / scale); - Debug::log(LOG, "Splash font size: %d, pos: %.2f, %.2f", FONTSIZE, (DIMENSIONS.x - textExtents.width) / 2.0 / scale, ((DIMENSIONS.y * (100 - *PSPLASHOFFSET)) / 100 - textExtents.height * scale) / scale); + Debug::log(LOG, "Splash font size: %d, pos: %.2f, %.2f", FONTSIZE, (DIMENSIONS.x - textExtents.width) / 2.0 / scale, ((DIMENSIONS.y * (100 - SPLASHOFFSET)) / 100 - textExtents.height * scale) / scale); cairo_show_text(PCAIRO, SPLASH.c_str());