From 736309ef1ff64b99c0f114178d6b83b4c69fb3b4 Mon Sep 17 00:00:00 2001 From: Tom Benham Date: Sun, 17 Mar 2024 23:00:48 +0100 Subject: [PATCH 1/5] Fixed segfault --- src/modules/hyprland/workspaces.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/modules/hyprland/workspaces.cpp b/src/modules/hyprland/workspaces.cpp index 9e368306..3eb408ac 100644 --- a/src/modules/hyprland/workspaces.cpp +++ b/src/modules/hyprland/workspaces.cpp @@ -235,7 +235,10 @@ void Workspaces::doUpdate() { auto wName = wNameRaw.starts_with("special:") ? wNameRaw.substr(8) : wNameRaw; return wName == workspace->name(); }); - workspace->setOutput((*updated_workspace)["monitor"].asString()); + + if (updated_workspace != updated_workspaces.end()) { + workspace->setOutput((*updated_workspace)["monitor"].asString()); + } workspace->update(m_format, workspaceIcon); } From 67218d555437d97434b4288613cb79cb820af720 Mon Sep 17 00:00:00 2001 From: leiserfg Date: Mon, 18 Mar 2024 21:48:06 +0100 Subject: [PATCH 2/5] Make right-click to circle down ppd --- src/modules/power_profiles_daemon.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/modules/power_profiles_daemon.cpp b/src/modules/power_profiles_daemon.cpp index ac5f7a2a..eaa47023 100644 --- a/src/modules/power_profiles_daemon.cpp +++ b/src/modules/power_profiles_daemon.cpp @@ -39,6 +39,7 @@ PowerProfilesDaemon::PowerProfilesDaemon(const std::string& id, const Json::Valu // adresses for compatibility sake. // // Revisit this in 2026, systems should be updated by then. + Gio::DBus::Proxy::create_for_bus(Gio::DBus::BusType::BUS_TYPE_SYSTEM, "net.hadess.PowerProfiles", "/net/hadess/PowerProfiles", "net.hadess.PowerProfiles", sigc::mem_fun(*this, &PowerProfilesDaemon::busConnectedCb)); @@ -175,9 +176,16 @@ auto PowerProfilesDaemon::update() -> void { bool PowerProfilesDaemon::handleToggle(GdkEventButton* const& e) { if (e->type == GdkEventType::GDK_BUTTON_PRESS && connected_) { - activeProfile_++; - if (activeProfile_ == availableProfiles_.end()) { - activeProfile_ = availableProfiles_.begin(); + if (e->button == 1) /* left click */ { + activeProfile_++; + if (activeProfile_ == availableProfiles_.end()) { + activeProfile_ = availableProfiles_.begin(); + } + } else { + if (activeProfile_ == availableProfiles_.begin()) { + activeProfile_ = availableProfiles_.end(); + } + activeProfile_--; } using VarStr = Glib::Variant; From 2ffd9a94a505a2e7e933ea8303f9cf2af33c35fe Mon Sep 17 00:00:00 2001 From: Jo De Boeck Date: Tue, 19 Mar 2024 07:40:35 +0200 Subject: [PATCH 3/5] Fix peristent class on buttons Fixes: #3009 Signed-off-by: Jo De Boeck --- src/modules/sway/workspaces.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/modules/sway/workspaces.cpp b/src/modules/sway/workspaces.cpp index 68f1ac45..8671288b 100644 --- a/src/modules/sway/workspaces.cpp +++ b/src/modules/sway/workspaces.cpp @@ -156,7 +156,7 @@ void Workspaces::onCmd(const struct Ipc::ipc_response &res) { if (output.asString() == bar_.output->name) { Json::Value v; v["name"] = p_w_name; - v["output"] = bar_.output->name; + v["target_output"] = bar_.output->name; v["num"] = convertWorkspaceNameToNum(p_w_name); workspaces_.emplace_back(std::move(v)); break; @@ -166,7 +166,7 @@ void Workspaces::onCmd(const struct Ipc::ipc_response &res) { // Adding to all outputs Json::Value v; v["name"] = p_w_name; - v["output"] = ""; + v["target_output"] = ""; v["num"] = convertWorkspaceNameToNum(p_w_name); workspaces_.emplace_back(std::move(v)); } @@ -313,7 +313,7 @@ auto Workspaces::update() -> void { } else { button.get_style_context()->remove_class("urgent"); } - if (hasFlag((*it), "target_output")) { + if ((*it)["target_output"].isString()) { button.get_style_context()->add_class("persistent"); } else { button.get_style_context()->remove_class("persistent"); From 856a34e16df9516939021c9bc42db674d0205227 Mon Sep 17 00:00:00 2001 From: hrdl <31923882+hrdl-github@users.noreply.github.com> Date: Mon, 18 Mar 2024 22:52:40 +0100 Subject: [PATCH 4/5] Also consider floating nodes when checking for flags Fixes #3030 --- src/modules/sway/workspaces.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/modules/sway/workspaces.cpp b/src/modules/sway/workspaces.cpp index 68f1ac45..77e74465 100644 --- a/src/modules/sway/workspaces.cpp +++ b/src/modules/sway/workspaces.cpp @@ -261,6 +261,10 @@ bool Workspaces::hasFlag(const Json::Value &node, const std::string &flag) { [&](auto const &e) { return hasFlag(e, flag); })) { return true; } + if (std::any_of(node["floating_nodes"].begin(), node["floating_nodes"].end(), + [&](auto const &e) { return hasFlag(e, flag); })) { + return true; + } return false; } From 6d690ad48b142bb9882ba31796bf27e5e9913da8 Mon Sep 17 00:00:00 2001 From: Mauro Guida Date: Wed, 20 Mar 2024 13:28:35 +0100 Subject: [PATCH 5/5] fix(wlr/taskbar): crash on taskbar drag and drop event --- src/modules/wlr/taskbar.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/modules/wlr/taskbar.cpp b/src/modules/wlr/taskbar.cpp index 2709584b..d291a6a5 100644 --- a/src/modules/wlr/taskbar.cpp +++ b/src/modules/wlr/taskbar.cpp @@ -334,9 +334,7 @@ Task::Task(const waybar::Bar &bar, const Json::Value &config, Taskbar *tbar, } button.add_events(Gdk::BUTTON_PRESS_MASK); - button.signal_button_press_event().connect(sigc::mem_fun(*this, &Task::handle_clicked), false); - button.signal_button_release_event().connect(sigc::mem_fun(*this, &Task::handle_button_release), - false); + button.signal_button_release_event().connect(sigc::mem_fun(*this, &Task::handle_clicked), false); button.signal_motion_notify_event().connect(sigc::mem_fun(*this, &Task::handle_motion_notify), false); @@ -573,12 +571,8 @@ bool Task::handle_clicked(GdkEventButton *bt) { else spdlog::warn("Unknown action {}", action); - return true; -} - -bool Task::handle_button_release(GdkEventButton *bt) { drag_start_button = -1; - return false; + return true; } bool Task::handle_motion_notify(GdkEventMotion *mn) {