From 445381f87177b90404d597e617915c8bad3c02b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Brandner?= Date: Sat, 1 Jun 2024 20:02:48 +0200 Subject: [PATCH] Damage tab bar each tick to avoid defects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This solution is hacky and needs to be improved Signed-off-by: Šimon Brandner --- src/TabGroup.cpp | 8 ++++++++ src/TabGroup.hpp | 1 + 2 files changed, 9 insertions(+) diff --git a/src/TabGroup.cpp b/src/TabGroup.cpp index 86eb679..5da614f 100644 --- a/src/TabGroup.cpp +++ b/src/TabGroup.cpp @@ -271,6 +271,14 @@ void Hy3TabBar::tick() { } if (this->entries.empty()) this->destroy = true; + + damage(); +} + +void Hy3TabBar::damage() { + auto pos = this->entries.front().node.position; + auto box = CBox {pos.x, pos.y, this->size.x, this->size.y}; + g_pHyprRenderer->damageBox(&box); } void Hy3TabBar::updateNodeList(std::list& nodes) { diff --git a/src/TabGroup.hpp b/src/TabGroup.hpp index 12117f3..5640958 100644 --- a/src/TabGroup.hpp +++ b/src/TabGroup.hpp @@ -67,6 +67,7 @@ public: Hy3TabBar(); void beginDestroy(); + void damage(); void tick(); void updateNodeList(std::list& nodes); void updateAnimations(bool warp = false);