@@ -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
9796void 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+ }
0 commit comments