summaryrefslogtreecommitdiff
path: root/src/render/OpenGL.cpp
diff options
context:
space:
mode:
authorvaxerski <vaxry@vaxry.net>2025-01-14 17:52:19 +0100
committervaxerski <vaxry@vaxry.net>2025-01-14 17:52:32 +0100
commit25add26881d7b98d2b80eb7a95d3aee0449b72b9 (patch)
tree95f71cc8df8552cea932d6260dba9d3598f28b50 /src/render/OpenGL.cpp
parentf16f170433540d85cf672217bca2d64c6db9eb01 (diff)
renderer: unload background texture if it's disabled
ref #9031
Diffstat (limited to 'src/render/OpenGL.cpp')
-rw-r--r--src/render/OpenGL.cpp21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/render/OpenGL.cpp b/src/render/OpenGL.cpp
index 3a4781e7..b68448ae 100644
--- a/src/render/OpenGL.cpp
+++ b/src/render/OpenGL.cpp
@@ -2699,10 +2699,6 @@ void CHyprOpenGLImpl::initMissingAssetTexture() {
void CHyprOpenGLImpl::initAssets() {
initMissingAssetTexture();
- static auto PFORCEWALLPAPER = CConfigValue<Hyprlang::INT>("misc:force_default_wallpaper");
-
- const auto FORCEWALLPAPER = std::clamp(*PFORCEWALLPAPER, static_cast<int64_t>(-1L), static_cast<int64_t>(2L));
-
m_pLockDeadTexture = loadAsset("lockdead.png");
m_pLockDead2Texture = loadAsset("lockdead2.png");
@@ -2712,9 +2708,20 @@ void CHyprOpenGLImpl::initAssets() {
"unknown"),
CHyprColor{0.9F, 0.9F, 0.9F, 0.7F}, 20, true);
- // create the default background texture
- {
- std::string texPath = std::format("{}", "wall");
+ ensureBackgroundTexturePresence();
+}
+
+void CHyprOpenGLImpl::ensureBackgroundTexturePresence() {
+ static auto PNOWALLPAPER = CConfigValue<Hyprlang::INT>("misc:disable_hyprland_logo");
+ static auto PFORCEWALLPAPER = CConfigValue<Hyprlang::INT>("misc:force_default_wallpaper");
+
+ const auto FORCEWALLPAPER = std::clamp(*PFORCEWALLPAPER, static_cast<int64_t>(-1L), static_cast<int64_t>(2L));
+
+ if (*PNOWALLPAPER)
+ m_pBackgroundTexture.reset();
+ else if (!m_pBackgroundTexture) {
+ // create the default background texture
+ std::string texPath = "wall";
// get the adequate tex
if (FORCEWALLPAPER == -1) {