From 695411f1bdad4535156602ba9b389b02713bc1b6 Mon Sep 17 00:00:00 2001 From: vaxerski Date: Fri, 23 Sep 2022 16:47:58 +0100 Subject: [PATCH] don't decorate on only no gaps --- src/Window.hpp | 1 + src/layout/DwindleLayout.cpp | 2 ++ src/layout/MasterLayout.cpp | 2 ++ src/render/decorations/CHyprDropShadowDecoration.cpp | 3 +++ src/render/decorations/CHyprGroupBarDecoration.cpp | 3 +++ 5 files changed, 11 insertions(+) diff --git a/src/Window.hpp b/src/Window.hpp index 5e2f4ba5..27611463 100644 --- a/src/Window.hpp +++ b/src/Window.hpp @@ -14,6 +14,7 @@ struct SWindowSpecialRenderData { // set by the layout bool rounding = true; bool border = true; + bool decorate = true; }; struct SWindowAdditionalConfigData { diff --git a/src/layout/DwindleLayout.cpp b/src/layout/DwindleLayout.cpp index 19716ede..d2fe55d7 100644 --- a/src/layout/DwindleLayout.cpp +++ b/src/layout/DwindleLayout.cpp @@ -196,12 +196,14 @@ void CHyprDwindleLayout::applyNodeDataToWindow(SDwindleNodeData* pNode, bool for PWINDOW->m_sSpecialRenderData.rounding = false; PWINDOW->m_sSpecialRenderData.border = false; + PWINDOW->m_sSpecialRenderData.decorate = false; return; } PWINDOW->m_sSpecialRenderData.rounding = true; PWINDOW->m_sSpecialRenderData.border = true; + PWINDOW->m_sSpecialRenderData.decorate = true; const auto OFFSETTOPLEFT = Vector2D(DISPLAYLEFT ? *PGAPSOUT : *PGAPSIN, DISPLAYTOP ? *PGAPSOUT : *PGAPSIN); diff --git a/src/layout/MasterLayout.cpp b/src/layout/MasterLayout.cpp index 3afca2c4..0c1d1dd1 100644 --- a/src/layout/MasterLayout.cpp +++ b/src/layout/MasterLayout.cpp @@ -252,12 +252,14 @@ void CHyprMasterLayout::applyNodeDataToWindow(SMasterNodeData* pNode) { PWINDOW->m_sSpecialRenderData.rounding = false; PWINDOW->m_sSpecialRenderData.border = false; + PWINDOW->m_sSpecialRenderData.decorate = false; return; } PWINDOW->m_sSpecialRenderData.rounding = true; PWINDOW->m_sSpecialRenderData.border = true; + PWINDOW->m_sSpecialRenderData.decorate = true; const auto OFFSETTOPLEFT = Vector2D(DISPLAYLEFT ? *PGAPSOUT : *PGAPSIN, DISPLAYTOP ? *PGAPSOUT : *PGAPSIN); diff --git a/src/render/decorations/CHyprDropShadowDecoration.cpp b/src/render/decorations/CHyprDropShadowDecoration.cpp index 14d97e99..8c9b23a3 100644 --- a/src/render/decorations/CHyprDropShadowDecoration.cpp +++ b/src/render/decorations/CHyprDropShadowDecoration.cpp @@ -56,6 +56,9 @@ void CHyprDropShadowDecoration::draw(CMonitor* pMonitor, float a) { if (m_pWindow->m_cRealShadowColor.col() == CColor(0, 0, 0, 0)) return; // don't draw invisible shadows + if (!m_pWindow->m_sSpecialRenderData.decorate) + return; + static auto *const PSHADOWS = &g_pConfigManager->getConfigValuePtr("decoration:drop_shadow")->intValue; static auto *const PSHADOWSIZE = &g_pConfigManager->getConfigValuePtr("decoration:shadow_range")->intValue; static auto *const PROUNDING = &g_pConfigManager->getConfigValuePtr("decoration:rounding")->intValue; diff --git a/src/render/decorations/CHyprGroupBarDecoration.cpp b/src/render/decorations/CHyprGroupBarDecoration.cpp index 8669e148..a60fc549 100644 --- a/src/render/decorations/CHyprGroupBarDecoration.cpp +++ b/src/render/decorations/CHyprGroupBarDecoration.cpp @@ -70,6 +70,9 @@ void CHyprGroupBarDecoration::draw(CMonitor* pMonitor, float a) { if (barsToDraw < 1 || m_pWindow->m_bHidden || !g_pCompositor->windowValidMapped(m_pWindow)) return; + if (!m_pWindow->m_sSpecialRenderData.decorate) + return; + const int PAD = 2; //2px const int BARW = (m_vLastWindowSize.x - PAD * (barsToDraw - 1)) / barsToDraw;