From 013bfb9f935d9459a0b9579b4f781fff58e357bb Mon Sep 17 00:00:00 2001 From: Henrik Nyman Date: Wed, 30 Oct 2019 20:27:06 +0200 Subject: [PATCH 01/12] Add suppport for displaying Waybar as an overlay layer Configuration option `layer` can now take a value "overlay", which draws the bar on top of the windows without creating an exclusive zone. --- src/bar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bar.cpp b/src/bar.cpp index 45e342017..8b7693784 100644 --- a/src/bar.cpp +++ b/src/bar.cpp @@ -260,7 +260,7 @@ void waybar::Bar::onMap(GdkEventAny* ev) { void waybar::Bar::setExclusiveZone(uint32_t width, uint32_t height) { auto zone = 0; - if (visible) { + if (visible && config["layer"] != "overlay") { // exclusive zone already includes margin for anchored edge, // only opposite margin should be added if (vertical) { From 0840184af6dc933b335d1fcaeb76ea16895b14a6 Mon Sep 17 00:00:00 2001 From: Henrik Nyman Date: Wed, 30 Oct 2019 20:38:14 +0200 Subject: [PATCH 02/12] Add module sway/hide for swaybar integration This allows auto-showing the bar when the modifier is pressed Closes #255 Setup instructions: - Set the `mode` of the bar to "hide" in sway configuration file - Set the `layer` of the bar to "overlay" in Waybar configuration file - Add "sway/hide" into `modules-left` in Waybar configuration file --- include/factory.hpp | 1 + include/modules/sway/hide.hpp | 33 ++++++++++++++++++++++++++++++ meson.build | 3 ++- src/factory.cpp | 3 +++ src/modules/sway/hide.cpp | 38 +++++++++++++++++++++++++++++++++++ 5 files changed, 77 insertions(+), 1 deletion(-) create mode 100644 include/modules/sway/hide.hpp create mode 100644 src/modules/sway/hide.cpp diff --git a/include/factory.hpp b/include/factory.hpp index ebc2359f9..d1658fae4 100644 --- a/include/factory.hpp +++ b/include/factory.hpp @@ -6,6 +6,7 @@ #include "modules/sway/mode.hpp" #include "modules/sway/window.hpp" #include "modules/sway/workspaces.hpp" +#include "modules/sway/hide.hpp" #endif #ifdef HAVE_WLR #include "modules/wlr/taskbar.hpp" diff --git a/include/modules/sway/hide.hpp b/include/modules/sway/hide.hpp new file mode 100644 index 000000000..3dd306765 --- /dev/null +++ b/include/modules/sway/hide.hpp @@ -0,0 +1,33 @@ +#pragma once + +#include +#include +#include "ALabel.hpp" +#include "bar.hpp" +#include "client.hpp" +#include "modules/sway/ipc/client.hpp" +#include "util/json.hpp" +#include "util/sleeper_thread.hpp" + +namespace waybar::modules::sway { + +class Hide : public ALabel, public sigc::trackable { + public: + Hide(const std::string&, const waybar::Bar&, const Json::Value&); + ~Hide() = default; + auto update() -> void; + + private: + void onEvent(const struct Ipc::ipc_response&); + void worker(); + + const Bar& bar_; + std::string window_; + int windowId_; + util::JsonParser parser_; + + util::SleeperThread thread_; + Ipc ipc_; +}; + +} // namespace waybar::modules::sway diff --git a/meson.build b/meson.build index acc8a470f..ccf94da0e 100644 --- a/meson.build +++ b/meson.build @@ -158,7 +158,8 @@ src_files += [ 'src/modules/sway/ipc/client.cpp', 'src/modules/sway/mode.cpp', 'src/modules/sway/window.cpp', - 'src/modules/sway/workspaces.cpp' + 'src/modules/sway/workspaces.cpp', + 'src/modules/sway/hide.cpp', ] if true diff --git a/src/factory.cpp b/src/factory.cpp index af93b20fd..f21880f93 100644 --- a/src/factory.cpp +++ b/src/factory.cpp @@ -22,6 +22,9 @@ waybar::AModule* waybar::Factory::makeModule(const std::string& name) const { if (ref == "sway/window") { return new waybar::modules::sway::Window(id, bar_, config_[name]); } + if (ref == "sway/hide") { + return new waybar::modules::sway::Hide(id, bar_, config_[name]); + } #endif #ifdef HAVE_WLR if (ref == "wlr/taskbar") { diff --git a/src/modules/sway/hide.cpp b/src/modules/sway/hide.cpp new file mode 100644 index 000000000..b31a7d3cf --- /dev/null +++ b/src/modules/sway/hide.cpp @@ -0,0 +1,38 @@ +#include "modules/sway/hide.hpp" +#include + +namespace waybar::modules::sway { + +Hide::Hide(const std::string& id, const Bar& bar, const Json::Value& config) + : ALabel(config, "hide", id, "{}", 0, true), bar_(bar), windowId_(-1) { + ipc_.subscribe(R"(["bar_state_update"])"); + ipc_.signal_event.connect(sigc::mem_fun(*this, &Hide::onEvent)); + bar_.window.get_style_context()->add_class("hidden"); + // Launch worker + worker(); +} + +void Hide::onEvent(const struct Ipc::ipc_response& res) { + + auto payload = parser_.parse(res.payload); + if (payload.isMember("visible_by_modifier")) { + if (payload["visible_by_modifier"].asBool()) + bar_.window.get_style_context()->remove_class("hidden"); + else + bar_.window.get_style_context()->add_class("hidden"); + } +} + +void Hide::worker() { + thread_ = [this] { + try { + ipc_.handleEvent(); + } catch (const std::exception& e) { + spdlog::error("Hide: {}", e.what()); + } + }; +} + +auto Hide::update() -> void { +} +} // namespace waybar::modules::sway From 0e32cff393e0ac1bd33bfa57e3bd506c990c9c53 Mon Sep 17 00:00:00 2001 From: somini Date: Mon, 21 Sep 2020 01:57:14 +0100 Subject: [PATCH 03/12] Use layer shell version 2 --- src/modules/sway/hide.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/modules/sway/hide.cpp b/src/modules/sway/hide.cpp index b31a7d3cf..15c2369cc 100644 --- a/src/modules/sway/hide.cpp +++ b/src/modules/sway/hide.cpp @@ -1,5 +1,7 @@ #include "modules/sway/hide.hpp" #include +#include "client.hpp" +#include "wlr-layer-shell-unstable-v1-client-protocol.h" namespace waybar::modules::sway { @@ -13,13 +15,23 @@ Hide::Hide(const std::string& id, const Bar& bar, const Json::Value& config) } void Hide::onEvent(const struct Ipc::ipc_response& res) { + auto client = waybar::Client::inst(); auto payload = parser_.parse(res.payload); if (payload.isMember("visible_by_modifier")) { - if (payload["visible_by_modifier"].asBool()) + if (payload["visible_by_modifier"].asBool()) { bar_.window.get_style_context()->remove_class("hidden"); - else + zwlr_layer_surface_v1_set_layer(bar_.layer_surface, + ZWLR_LAYER_SHELL_V1_LAYER_TOP + | ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY); + } else { bar_.window.get_style_context()->add_class("hidden"); + zwlr_layer_surface_v1_set_layer(bar_.layer_surface, + ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM); + } + + wl_surface_commit(bar_.surface); + wl_display_roundtrip(client->wl_display); } } From 4ecb22b192129ad31f39cc477e59c2ea03b1544b Mon Sep 17 00:00:00 2001 From: gammafn Date: Thu, 2 Jan 2020 08:22:09 -0600 Subject: [PATCH 04/12] (does not build) try to use barconfig_update Currently, it won't build. I am unfamiliar with C++, I don't know what's wrong. --- include/modules/sway/hide.hpp | 2 ++ src/modules/sway/hide.cpp | 39 +++++++++++++++++++++-------------- 2 files changed, 26 insertions(+), 15 deletions(-) diff --git a/include/modules/sway/hide.hpp b/include/modules/sway/hide.hpp index 3dd306765..1e4630893 100644 --- a/include/modules/sway/hide.hpp +++ b/include/modules/sway/hide.hpp @@ -21,6 +21,8 @@ class Hide : public ALabel, public sigc::trackable { void onEvent(const struct Ipc::ipc_response&); void worker(); + std::string current_mode; + bool visible_on_modifier; const Bar& bar_; std::string window_; int windowId_; diff --git a/src/modules/sway/hide.cpp b/src/modules/sway/hide.cpp index 15c2369cc..d85f92de9 100644 --- a/src/modules/sway/hide.cpp +++ b/src/modules/sway/hide.cpp @@ -5,9 +5,12 @@ namespace waybar::modules::sway { +std::string current_mode = "hide"; +bool visible_by_modifier = true; + Hide::Hide(const std::string& id, const Bar& bar, const Json::Value& config) : ALabel(config, "hide", id, "{}", 0, true), bar_(bar), windowId_(-1) { - ipc_.subscribe(R"(["bar_state_update"])"); + ipc_.subscribe(R"(["bar_state_update","barconfig_update"])"); ipc_.signal_event.connect(sigc::mem_fun(*this, &Hide::onEvent)); bar_.window.get_style_context()->add_class("hidden"); // Launch worker @@ -18,21 +21,27 @@ void Hide::onEvent(const struct Ipc::ipc_response& res) { auto client = waybar::Client::inst(); auto payload = parser_.parse(res.payload); - if (payload.isMember("visible_by_modifier")) { - if (payload["visible_by_modifier"].asBool()) { - bar_.window.get_style_context()->remove_class("hidden"); - zwlr_layer_surface_v1_set_layer(bar_.layer_surface, - ZWLR_LAYER_SHELL_V1_LAYER_TOP - | ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY); - } else { - bar_.window.get_style_context()->add_class("hidden"); - zwlr_layer_surface_v1_set_layer(bar_.layer_surface, - ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM); - } - - wl_surface_commit(bar_.surface); - wl_display_roundtrip(client->wl_display); + if (payload.isMember("mode")) { + // barconfig_update: get mode + current_mode = payload["mode"]; + } else if (payload.isMember("visible_by_modifier")) { + // bar_state_update: get visible_by_modifier + visible_by_modifier = payload["visible_by_modifier"].asBool(); + } + if (current_mode == "invisible" + || (current_mode == "hide" && ! visible_by_modifier)) { + bar_.window.get_style_context()->add_class("hidden"); + zwlr_layer_surface_v1_set_layer(bar_.layer_surface, + ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM); + } else { + // TODO: support "bar mode overlay" + bar_.window.get_style_context()->remove_class("hidden"); + zwlr_layer_surface_v1_set_layer(bar_.layer_surface, + ZWLR_LAYER_SHELL_V1_LAYER_TOP + | ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY); } + wl_surface_commit(bar_.surface); + wl_display_roundtrip(client->wl_display); } void Hide::worker() { From 4ec1718454cd719aad3980f2bdc25a32b982be98 Mon Sep 17 00:00:00 2001 From: gammafn Date: Thu, 2 Jan 2020 09:50:40 -0600 Subject: [PATCH 05/12] fix: thanks nyyManni This is also a rebase-fix --- include/bar.hpp | 2 +- include/modules/sway/hide.hpp | 4 ++-- src/modules/sway/hide.cpp | 11 ++++------- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/include/bar.hpp b/include/bar.hpp index fdc5a7397..46e2cab1d 100644 --- a/include/bar.hpp +++ b/include/bar.hpp @@ -35,6 +35,7 @@ class Bar { struct waybar_output *output; Json::Value config; struct wl_surface * surface; + struct zwlr_layer_surface_v1 *layer_surface_; bool visible = true; bool vertical = false; Gtk::Window window; @@ -76,7 +77,6 @@ class Bar { int bottom = 0; int left = 0; } margins_; - struct zwlr_layer_surface_v1 *layer_surface_; // use gtk-layer-shell instead of handling layer surfaces directly bool use_gls_ = false; uint32_t width_ = 0; diff --git a/include/modules/sway/hide.hpp b/include/modules/sway/hide.hpp index 1e4630893..f3374b2a1 100644 --- a/include/modules/sway/hide.hpp +++ b/include/modules/sway/hide.hpp @@ -21,8 +21,8 @@ class Hide : public ALabel, public sigc::trackable { void onEvent(const struct Ipc::ipc_response&); void worker(); - std::string current_mode; - bool visible_on_modifier; + std::string current_mode_; + bool visible_by_modifier_; const Bar& bar_; std::string window_; int windowId_; diff --git a/src/modules/sway/hide.cpp b/src/modules/sway/hide.cpp index d85f92de9..cfc31af1a 100644 --- a/src/modules/sway/hide.cpp +++ b/src/modules/sway/hide.cpp @@ -5,9 +5,6 @@ namespace waybar::modules::sway { -std::string current_mode = "hide"; -bool visible_by_modifier = true; - Hide::Hide(const std::string& id, const Bar& bar, const Json::Value& config) : ALabel(config, "hide", id, "{}", 0, true), bar_(bar), windowId_(-1) { ipc_.subscribe(R"(["bar_state_update","barconfig_update"])"); @@ -23,13 +20,13 @@ void Hide::onEvent(const struct Ipc::ipc_response& res) { auto payload = parser_.parse(res.payload); if (payload.isMember("mode")) { // barconfig_update: get mode - current_mode = payload["mode"]; + current_mode_ = payload["mode"].asString(); } else if (payload.isMember("visible_by_modifier")) { // bar_state_update: get visible_by_modifier - visible_by_modifier = payload["visible_by_modifier"].asBool(); + visible_by_modifier_ = payload["visible_by_modifier"].asBool(); } - if (current_mode == "invisible" - || (current_mode == "hide" && ! visible_by_modifier)) { + if (current_mode_ == "invisible" + || (current_mode_ == "hide" && ! visible_by_modifier_)) { bar_.window.get_style_context()->add_class("hidden"); zwlr_layer_surface_v1_set_layer(bar_.layer_surface, ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM); From 551973a9c922f2985be2b1217582453135307ca9 Mon Sep 17 00:00:00 2001 From: somini Date: Mon, 21 Sep 2020 02:52:29 +0100 Subject: [PATCH 06/12] Define bar setVisible method Call this when toggling visibility with SIGUSR1, and for `sway/hide` events. --- include/bar.hpp | 3 ++- src/bar.cpp | 8 ++++++-- src/modules/sway/hide.cpp | 21 +++++---------------- 3 files changed, 13 insertions(+), 19 deletions(-) diff --git a/include/bar.hpp b/include/bar.hpp index 46e2cab1d..ad83c8a23 100644 --- a/include/bar.hpp +++ b/include/bar.hpp @@ -30,12 +30,12 @@ class Bar { ~Bar() = default; auto toggle() -> void; + auto setVisible(bool) -> void; void handleSignal(int); struct waybar_output *output; Json::Value config; struct wl_surface * surface; - struct zwlr_layer_surface_v1 *layer_surface_; bool visible = true; bool vertical = false; Gtk::Window window; @@ -77,6 +77,7 @@ class Bar { int bottom = 0; int left = 0; } margins_; + struct zwlr_layer_surface_v1 *layer_surface_; // use gtk-layer-shell instead of handling layer surfaces directly bool use_gls_ = false; uint32_t width_ = 0; diff --git a/src/bar.cpp b/src/bar.cpp index 8b7693784..d407ebe48 100644 --- a/src/bar.cpp +++ b/src/bar.cpp @@ -389,8 +389,8 @@ void waybar::Bar::layerSurfaceHandleClosed(void* data, struct zwlr_layer_surface o->modules_right_.clear(); } -auto waybar::Bar::toggle() -> void { - visible = !visible; +auto waybar::Bar::setVisible(bool nvis) -> void { + visible = nvis; if (!visible) { window.get_style_context()->add_class("hidden"); window.set_opacity(0); @@ -404,6 +404,10 @@ auto waybar::Bar::toggle() -> void { } } +auto waybar::Bar::toggle() -> void { + return setVisible(!visible); +} + void waybar::Bar::getModules(const Factory& factory, const std::string& pos) { if (config[pos].isArray()) { for (const auto& name : config[pos]) { diff --git a/src/modules/sway/hide.cpp b/src/modules/sway/hide.cpp index cfc31af1a..9d365e447 100644 --- a/src/modules/sway/hide.cpp +++ b/src/modules/sway/hide.cpp @@ -1,3 +1,4 @@ +#include #include "modules/sway/hide.hpp" #include #include "client.hpp" @@ -15,8 +16,6 @@ Hide::Hide(const std::string& id, const Bar& bar, const Json::Value& config) } void Hide::onEvent(const struct Ipc::ipc_response& res) { - auto client = waybar::Client::inst(); - auto payload = parser_.parse(res.payload); if (payload.isMember("mode")) { // barconfig_update: get mode @@ -24,21 +23,11 @@ void Hide::onEvent(const struct Ipc::ipc_response& res) { } else if (payload.isMember("visible_by_modifier")) { // bar_state_update: get visible_by_modifier visible_by_modifier_ = payload["visible_by_modifier"].asBool(); + std::cerr << "WayBar Hide: " << payload["visible_by_modifier"] << std::endl; + for (auto& bar : waybar::Client::inst()->bars) { + bar->setVisible(visible_by_modifier_); + } } - if (current_mode_ == "invisible" - || (current_mode_ == "hide" && ! visible_by_modifier_)) { - bar_.window.get_style_context()->add_class("hidden"); - zwlr_layer_surface_v1_set_layer(bar_.layer_surface, - ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM); - } else { - // TODO: support "bar mode overlay" - bar_.window.get_style_context()->remove_class("hidden"); - zwlr_layer_surface_v1_set_layer(bar_.layer_surface, - ZWLR_LAYER_SHELL_V1_LAYER_TOP - | ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY); - } - wl_surface_commit(bar_.surface); - wl_display_roundtrip(client->wl_display); } void Hide::worker() { From 2253f3e0a27be97a2b9d2e1a4e987dba530846e5 Mon Sep 17 00:00:00 2001 From: somini Date: Mon, 21 Sep 2020 23:13:36 +0100 Subject: [PATCH 07/12] Include mutext on Hide::onEvent This doesn't solve the issue, but it crashes less often... --- include/modules/sway/hide.hpp | 2 ++ src/modules/sway/hide.cpp | 1 + 2 files changed, 3 insertions(+) diff --git a/include/modules/sway/hide.hpp b/include/modules/sway/hide.hpp index f3374b2a1..90a054d88 100644 --- a/include/modules/sway/hide.hpp +++ b/include/modules/sway/hide.hpp @@ -2,6 +2,7 @@ #include #include +#include #include "ALabel.hpp" #include "bar.hpp" #include "client.hpp" @@ -29,6 +30,7 @@ class Hide : public ALabel, public sigc::trackable { util::JsonParser parser_; util::SleeperThread thread_; + std::mutex mutex_; Ipc ipc_; }; diff --git a/src/modules/sway/hide.cpp b/src/modules/sway/hide.cpp index 9d365e447..4a7d8c6a6 100644 --- a/src/modules/sway/hide.cpp +++ b/src/modules/sway/hide.cpp @@ -17,6 +17,7 @@ Hide::Hide(const std::string& id, const Bar& bar, const Json::Value& config) void Hide::onEvent(const struct Ipc::ipc_response& res) { auto payload = parser_.parse(res.payload); + std::lock_guard lock(mutex_); if (payload.isMember("mode")) { // barconfig_update: get mode current_mode_ = payload["mode"].asString(); From f1cd85f9babec86ed02a90392bd730bfcb0cfc2f Mon Sep 17 00:00:00 2001 From: somini Date: Mon, 21 Sep 2020 23:14:17 +0100 Subject: [PATCH 08/12] Improve debug logs --- src/modules/sway/hide.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/sway/hide.cpp b/src/modules/sway/hide.cpp index 4a7d8c6a6..b33f5f647 100644 --- a/src/modules/sway/hide.cpp +++ b/src/modules/sway/hide.cpp @@ -24,7 +24,7 @@ void Hide::onEvent(const struct Ipc::ipc_response& res) { } else if (payload.isMember("visible_by_modifier")) { // bar_state_update: get visible_by_modifier visible_by_modifier_ = payload["visible_by_modifier"].asBool(); - std::cerr << "WayBar Hide: " << payload["visible_by_modifier"] << std::endl; + std::cerr << "WayBar Shown: " << payload["visible_by_modifier"] << std::endl; for (auto& bar : waybar::Client::inst()->bars) { bar->setVisible(visible_by_modifier_); } From af0b18285ee680bb7b1da456e708302876f14531 Mon Sep 17 00:00:00 2001 From: somini Date: Mon, 21 Sep 2020 23:14:39 +0100 Subject: [PATCH 09/12] Remove support for "overlay" layer Keep this as similar to "upstream" as possible. --- src/bar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bar.cpp b/src/bar.cpp index d407ebe48..5f2cac277 100644 --- a/src/bar.cpp +++ b/src/bar.cpp @@ -260,7 +260,7 @@ void waybar::Bar::onMap(GdkEventAny* ev) { void waybar::Bar::setExclusiveZone(uint32_t width, uint32_t height) { auto zone = 0; - if (visible && config["layer"] != "overlay") { + if (visible) { // exclusive zone already includes margin for anchored edge, // only opposite margin should be added if (vertical) { From d427a5b709a5beea22e6c71c00e8db13548275c8 Mon Sep 17 00:00:00 2001 From: somini Date: Mon, 21 Sep 2020 23:25:30 +0100 Subject: [PATCH 10/12] Hide the bar on creation, in "hide" mode --- src/modules/sway/hide.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/modules/sway/hide.cpp b/src/modules/sway/hide.cpp index b33f5f647..ad76313a2 100644 --- a/src/modules/sway/hide.cpp +++ b/src/modules/sway/hide.cpp @@ -20,7 +20,13 @@ void Hide::onEvent(const struct Ipc::ipc_response& res) { std::lock_guard lock(mutex_); if (payload.isMember("mode")) { // barconfig_update: get mode - current_mode_ = payload["mode"].asString(); + auto mode = payload["mode"].asString(); + if (mode == "hide") { + // Hide the bars when configuring the "hide" bar + for (auto& bar : waybar::Client::inst()->bars) { + bar->setVisible(false); + } + } } else if (payload.isMember("visible_by_modifier")) { // bar_state_update: get visible_by_modifier visible_by_modifier_ = payload["visible_by_modifier"].asBool(); From 3b1564510ee294f3f3f08fce6fbe3ee42ad412c5 Mon Sep 17 00:00:00 2001 From: somini Date: Mon, 21 Sep 2020 23:33:14 +0100 Subject: [PATCH 11/12] Use logging module --- src/modules/sway/hide.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/modules/sway/hide.cpp b/src/modules/sway/hide.cpp index ad76313a2..e370c86ef 100644 --- a/src/modules/sway/hide.cpp +++ b/src/modules/sway/hide.cpp @@ -1,4 +1,3 @@ -#include #include "modules/sway/hide.hpp" #include #include "client.hpp" @@ -30,7 +29,7 @@ void Hide::onEvent(const struct Ipc::ipc_response& res) { } else if (payload.isMember("visible_by_modifier")) { // bar_state_update: get visible_by_modifier visible_by_modifier_ = payload["visible_by_modifier"].asBool(); - std::cerr << "WayBar Shown: " << payload["visible_by_modifier"] << std::endl; + spdlog::info("WayBar Shown: {}", visible_by_modifier_); for (auto& bar : waybar::Client::inst()->bars) { bar->setVisible(visible_by_modifier_); } From 979a478ddfd0559fef64771500f00611a48556b1 Mon Sep 17 00:00:00 2001 From: somini Date: Mon, 21 Sep 2020 23:35:43 +0100 Subject: [PATCH 12/12] Don't auto-hide the bar on start This is a CSS-only change. It should be properly hidden. --- src/modules/sway/hide.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/modules/sway/hide.cpp b/src/modules/sway/hide.cpp index e370c86ef..b8f6f7ab1 100644 --- a/src/modules/sway/hide.cpp +++ b/src/modules/sway/hide.cpp @@ -9,7 +9,6 @@ Hide::Hide(const std::string& id, const Bar& bar, const Json::Value& config) : ALabel(config, "hide", id, "{}", 0, true), bar_(bar), windowId_(-1) { ipc_.subscribe(R"(["bar_state_update","barconfig_update"])"); ipc_.signal_event.connect(sigc::mem_fun(*this, &Hide::onEvent)); - bar_.window.get_style_context()->add_class("hidden"); // Launch worker worker(); }