From 7cdde05568fb3a750de254afa996ea60cf5c22ae Mon Sep 17 00:00:00 2001 From: Adam Pioterek Date: Sat, 11 May 2019 20:36:10 +0200 Subject: [PATCH] remove empty and solo classes when they do not apply --- src/modules/sway/window.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/modules/sway/window.cpp b/src/modules/sway/window.cpp index 2f0287f..2bccb60 100644 --- a/src/modules/sway/window.cpp +++ b/src/modules/sway/window.cpp @@ -31,8 +31,10 @@ void Window::onCmd(const struct Ipc::ipc_response& res) { bar_.window.get_style_context()->remove_class(app_id_); } if (nb == 0) { + bar_.window.get_style_context()->remove_class("solo"); bar_.window.get_style_context()->add_class("empty"); } else if (nb == 1) { + bar_.window.get_style_context()->remove_class("empty"); bar_.window.get_style_context()->add_class("solo"); if (!app_id.empty()) { bar_.window.get_style_context()->add_class(app_id); @@ -99,4 +101,4 @@ void Window::getTree() { } } -} // namespace waybar::modules::sway \ No newline at end of file +} // namespace waybar::modules::sway