diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index 8302dfec..437e2b5e 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -127,6 +127,7 @@ void CConfigManager::setDefaultVars() { configValues["group:insert_after_current"].intValue = 1; configValues["group:focus_removed_window"].intValue = 1; + configValues["group:groupbar:enabled"].intValue = 1; configValues["group:groupbar:font"].strValue = "Sans"; configValues["group:groupbar:height"].intValue = 20; configValues["group:groupbar:mode"].intValue = 1; diff --git a/src/render/decorations/CHyprGroupBarDecoration.cpp b/src/render/decorations/CHyprGroupBarDecoration.cpp index 6f764f9a..346393eb 100644 --- a/src/render/decorations/CHyprGroupBarDecoration.cpp +++ b/src/render/decorations/CHyprGroupBarDecoration.cpp @@ -72,7 +72,7 @@ void CHyprGroupBarDecoration::damageEntire() { } void CHyprGroupBarDecoration::draw(CMonitor* pMonitor, float a, const Vector2D& offset) { - if (!m_pWindow->m_sSpecialRenderData.decorate) + if (!m_pWindow->m_sSpecialRenderData.decorate || !m_bEnabled) return; int barsToDraw = m_dwGroupMembers.size(); @@ -339,19 +339,26 @@ void CHyprGroupBarDecoration::refreshGradients() { } void CHyprGroupBarDecoration::forceReload(CWindow* pWindow) { + static auto* const PENABLED = &g_pConfigManager->getConfigValuePtr("group:groupbar:enabled")->intValue; static auto* const PMODE = &g_pConfigManager->getConfigValuePtr("group:groupbar:mode")->intValue; static auto* const PHEIGHT = &g_pConfigManager->getConfigValuePtr("group:groupbar:height")->intValue; static auto* const PINTERNALBORDER = &g_pConfigManager->getConfigValuePtr("group:groupbar:internal_bar")->intValue; + m_bEnabled = *PENABLED; m_iBarInternalHeight = *PHEIGHT + (*PMODE == 1 ? BAR_INDICATOR_HEIGHT + BAR_INTERNAL_PADDING : 0); m_iBarFullHeight = m_iBarInternalHeight + BAR_INTERNAL_PADDING + BAR_EXTERNAL_PADDING; m_bOnTop = g_pConfigManager->getConfigValuePtr("group:groupbar:top")->intValue; m_bInternalBorder = *PINTERNALBORDER; - m_seExtents.topLeft = Vector2D(0, m_bOnTop ? m_iBarFullHeight : 0); - m_seExtents.bottomRight = Vector2D(0, m_bOnTop ? 0 : m_iBarFullHeight); - m_seExtents.isInternalDecoration = *PINTERNALBORDER; + if (m_bEnabled) { + m_seExtents.topLeft = Vector2D(0, m_bOnTop ? m_iBarFullHeight : 0); + m_seExtents.bottomRight = Vector2D(0, m_bOnTop ? 0 : m_iBarFullHeight); + m_seExtents.isInternalDecoration = *PINTERNALBORDER; + } else { + m_seExtents.topLeft = Vector2D(0, 0); + m_seExtents.bottomRight = Vector2D(0, 0); + } m_iBarHeight = *PMODE != 1 ? *PHEIGHT : BAR_INDICATOR_HEIGHT; m_iGradientHeight = *PMODE == 1 ? *PHEIGHT : 0; diff --git a/src/render/decorations/CHyprGroupBarDecoration.hpp b/src/render/decorations/CHyprGroupBarDecoration.hpp index 1044d2a0..628a429a 100644 --- a/src/render/decorations/CHyprGroupBarDecoration.hpp +++ b/src/render/decorations/CHyprGroupBarDecoration.hpp @@ -47,6 +47,7 @@ class CHyprGroupBarDecoration : public IHyprWindowDecoration { std::deque m_dwGroupMembers; + bool m_bEnabled; int m_iBarInternalHeight; int m_iBarFullHeight; bool m_bOnTop;