From f4c6dfcddc032a008f4b119edfc519fc4b38f64e Mon Sep 17 00:00:00 2001 From: Daniel Moore Date: Sat, 12 Mar 2022 13:32:08 -0700 Subject: [PATCH] Uses user-defined mode when toggling visibility rather than resetting to default mode --- src/bar.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/bar.cpp b/src/bar.cpp index eb00dd15..d4319ff0 100644 --- a/src/bar.cpp +++ b/src/bar.cpp @@ -665,7 +665,11 @@ void waybar::Bar::onMap(GdkEventAny*) { void waybar::Bar::setVisible(bool value) { visible = value; - setMode(visible ? MODE_DEFAULT : MODE_INVISIBLE); + if (auto mode = config.get("mode", {}); mode.isString()) { + setMode(visible ? config["mode"].asString() : MODE_INVISIBLE); + } else { + setMode(visible ? MODE_DEFAULT : MODE_INVISIBLE); + } } void waybar::Bar::toggle() { setVisible(!visible); }