Skip to content

Commit 5cc6cb4

Browse files
committed
groupbar: force recalc on visibility changes
fixes #10566
1 parent 9b327dd commit 5cc6cb4

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

src/render/decorations/CHyprGroupBarDecoration.cpp

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ SDecorationPositioningInfo CHyprGroupBarDecoration::getPositioningInfo() {
2929
static auto PHEIGHT = CConfigValue<Hyprlang::INT>("group:groupbar:height");
3030
static auto PINDICATORGAP = CConfigValue<Hyprlang::INT>("group:groupbar:indicator_gap");
3131
static auto PINDICATORHEIGHT = CConfigValue<Hyprlang::INT>("group:groupbar:indicator_height");
32-
static auto PENABLED = CConfigValue<Hyprlang::INT>("group:groupbar:enabled");
3332
static auto PRENDERTITLES = CConfigValue<Hyprlang::INT>("group:groupbar:render_titles");
3433
static auto PGRADIENTS = CConfigValue<Hyprlang::INT>("group:groupbar:gradients");
3534
static auto PPRIORITY = CConfigValue<Hyprlang::INT>("group:groupbar:priority");
@@ -43,7 +42,7 @@ SDecorationPositioningInfo CHyprGroupBarDecoration::getPositioningInfo() {
4342
info.priority = *PPRIORITY;
4443
info.reserved = true;
4544

46-
if (*PENABLED && m_window->m_windowData.decorate.valueOrDefault()) {
45+
if (visible()) {
4746
if (*PSTACKED) {
4847
const auto ONEBARHEIGHT = *POUTERGAP + *PINDICATORHEIGHT + *PINDICATORGAP + (*PGRADIENTS || *PRENDERTITLES ? *PHEIGHT : 0);
4948
info.desiredExtents = {{0, (ONEBARHEIGHT * m_dwGroupMembers.size()) + (*PKEEPUPPERGAP * *POUTERGAP)}, {0, 0}};
@@ -96,11 +95,14 @@ void CHyprGroupBarDecoration::damageEntire() {
9695

9796
void CHyprGroupBarDecoration::draw(PHLMONITOR pMonitor, float const& a) {
9897
// get how many bars we will draw
99-
int barsToDraw = m_dwGroupMembers.size();
98+
int barsToDraw = m_dwGroupMembers.size();
10099

101-
static auto PENABLED = CConfigValue<Hyprlang::INT>("group:groupbar:enabled");
100+
const bool VISIBLE = visible();
101+
102+
if (VISIBLE != m_bLastVisibilityStatus)
103+
g_pDecorationPositioner->repositionDeco(this);
102104

103-
if (!*PENABLED || !m_window->m_windowData.decorate.valueOrDefault())
105+
if (!VISIBLE)
104106
return;
105107

106108
static auto PRENDERTITLES = CConfigValue<Hyprlang::INT>("group:groupbar:render_titles");
@@ -583,3 +585,8 @@ CBox CHyprGroupBarDecoration::assignedBoxGlobal() {
583585

584586
return box.round();
585587
}
588+
589+
bool CHyprGroupBarDecoration::visible() {
590+
static auto PENABLED = CConfigValue<Hyprlang::INT>("group:groupbar:enabled");
591+
return *PENABLED && m_window->m_windowData.decorate.valueOrDefault();
592+
}

src/render/decorations/CHyprGroupBarDecoration.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,13 @@ class CHyprGroupBarDecoration : public IHyprWindowDecoration {
5656
float m_barWidth;
5757
float m_barHeight;
5858

59+
bool m_bLastVisibilityStatus = true;
60+
5961
CTitleTex* textureFromTitle(const std::string&);
6062
void invalidateTextures();
6163

6264
CBox assignedBoxGlobal();
65+
bool visible();
6366

6467
bool onBeginWindowDragOnDeco(const Vector2D&);
6568
bool onEndWindowDragOnDeco(const Vector2D&, PHLWINDOW);

0 commit comments

Comments
 (0)