From 1f6ad2aab7544db7f686fbfdf92d1e23b3baaf1e Mon Sep 17 00:00:00 2001 From: scorpion-26 Date: Wed, 1 Nov 2023 17:08:13 +0100 Subject: [PATCH] Don't destroy unused Widget for SensorTooltips We would create the Revealer and then destroy it when SensorTooltips is true --- src/Bar.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Bar.cpp b/src/Bar.cpp index 78f04fb..0f6052c 100644 --- a/src/Bar.cpp +++ b/src/Bar.cpp @@ -423,9 +423,10 @@ namespace Bar box->SetSpacing({0, false}); box->SetOrientation(Utils::GetOrientation()); { - auto revealer = Widget::Create(); + std::unique_ptr revealer = nullptr; if (!Config::Get().sensorTooltips) { + revealer = Widget::Create(); revealer->SetTransition({Utils::GetTransitionType(SideToDefaultTransition(side)), 500}); // Add event to eventbox for the revealer to open eventBox->SetHoverFn( @@ -666,7 +667,7 @@ namespace Bar { Utils::SetTransform(*devText, {-1, true, Alignment::Fill, 6, 0}); } - else if(RotatedIcons()) + else if (RotatedIcons()) { Utils::SetTransform(*devText, {}, 6, 0); }