diff options
| author | vaxerski <vaxry@vaxry.net> | 2025-05-28 15:18:30 +0200 |
|---|---|---|
| committer | vaxerski <vaxry@vaxry.net> | 2025-05-28 15:18:30 +0200 |
| commit | 5cc6cb49458634bd277ada22dfffe6f189cd7d34 (patch) | |
| tree | 400e7084589a32e7a274012104f4c2890b5afc73 /src/render/decorations | |
| parent | 9b327ddfd1ad4cfef7a04a178e9f0aed16e95e0a (diff) | |
groupbar: force recalc on visibility changes
fixes #10566
Diffstat (limited to 'src/render/decorations')
| -rw-r--r-- | src/render/decorations/CHyprGroupBarDecoration.cpp | 17 | ||||
| -rw-r--r-- | src/render/decorations/CHyprGroupBarDecoration.hpp | 3 |
2 files changed, 15 insertions, 5 deletions
diff --git a/src/render/decorations/CHyprGroupBarDecoration.cpp b/src/render/decorations/CHyprGroupBarDecoration.cpp index 84060e0d..65d7d7ff 100644 --- a/src/render/decorations/CHyprGroupBarDecoration.cpp +++ b/src/render/decorations/CHyprGroupBarDecoration.cpp @@ -29,7 +29,6 @@ SDecorationPositioningInfo CHyprGroupBarDecoration::getPositioningInfo() { static auto PHEIGHT = CConfigValue<Hyprlang::INT>("group:groupbar:height"); static auto PINDICATORGAP = CConfigValue<Hyprlang::INT>("group:groupbar:indicator_gap"); static auto PINDICATORHEIGHT = CConfigValue<Hyprlang::INT>("group:groupbar:indicator_height"); - static auto PENABLED = CConfigValue<Hyprlang::INT>("group:groupbar:enabled"); static auto PRENDERTITLES = CConfigValue<Hyprlang::INT>("group:groupbar:render_titles"); static auto PGRADIENTS = CConfigValue<Hyprlang::INT>("group:groupbar:gradients"); static auto PPRIORITY = CConfigValue<Hyprlang::INT>("group:groupbar:priority"); @@ -43,7 +42,7 @@ SDecorationPositioningInfo CHyprGroupBarDecoration::getPositioningInfo() { info.priority = *PPRIORITY; info.reserved = true; - if (*PENABLED && m_window->m_windowData.decorate.valueOrDefault()) { + if (visible()) { if (*PSTACKED) { const auto ONEBARHEIGHT = *POUTERGAP + *PINDICATORHEIGHT + *PINDICATORGAP + (*PGRADIENTS || *PRENDERTITLES ? *PHEIGHT : 0); info.desiredExtents = {{0, (ONEBARHEIGHT * m_dwGroupMembers.size()) + (*PKEEPUPPERGAP * *POUTERGAP)}, {0, 0}}; @@ -96,11 +95,14 @@ void CHyprGroupBarDecoration::damageEntire() { void CHyprGroupBarDecoration::draw(PHLMONITOR pMonitor, float const& a) { // get how many bars we will draw - int barsToDraw = m_dwGroupMembers.size(); + int barsToDraw = m_dwGroupMembers.size(); - static auto PENABLED = CConfigValue<Hyprlang::INT>("group:groupbar:enabled"); + const bool VISIBLE = visible(); + + if (VISIBLE != m_bLastVisibilityStatus) + g_pDecorationPositioner->repositionDeco(this); - if (!*PENABLED || !m_window->m_windowData.decorate.valueOrDefault()) + if (!VISIBLE) return; static auto PRENDERTITLES = CConfigValue<Hyprlang::INT>("group:groupbar:render_titles"); @@ -583,3 +585,8 @@ CBox CHyprGroupBarDecoration::assignedBoxGlobal() { return box.round(); } + +bool CHyprGroupBarDecoration::visible() { + static auto PENABLED = CConfigValue<Hyprlang::INT>("group:groupbar:enabled"); + return *PENABLED && m_window->m_windowData.decorate.valueOrDefault(); +} diff --git a/src/render/decorations/CHyprGroupBarDecoration.hpp b/src/render/decorations/CHyprGroupBarDecoration.hpp index feb304f2..5e1abc5a 100644 --- a/src/render/decorations/CHyprGroupBarDecoration.hpp +++ b/src/render/decorations/CHyprGroupBarDecoration.hpp @@ -56,10 +56,13 @@ class CHyprGroupBarDecoration : public IHyprWindowDecoration { float m_barWidth; float m_barHeight; + bool m_bLastVisibilityStatus = true; + CTitleTex* textureFromTitle(const std::string&); void invalidateTextures(); CBox assignedBoxGlobal(); + bool visible(); bool onBeginWindowDragOnDeco(const Vector2D&); bool onEndWindowDragOnDeco(const Vector2D&, PHLWINDOW); |
