From 53233e47a313773dab278879ce6cf9866ea9ed22 Mon Sep 17 00:00:00 2001 From: dpayne Date: Sun, 21 Jan 2024 19:08:23 -0800 Subject: [PATCH 1/3] Fix use after free on task close --- src/modules/wlr/taskbar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/wlr/taskbar.cpp b/src/modules/wlr/taskbar.cpp index 9a8b89e7..0eaf264a 100644 --- a/src/modules/wlr/taskbar.cpp +++ b/src/modules/wlr/taskbar.cpp @@ -527,11 +527,11 @@ void Task::handle_closed() { spdlog::debug("{} closed", repr()); zwlr_foreign_toplevel_handle_v1_destroy(handle_); handle_ = nullptr; - tbar_->remove_task(id_); if (button_visible_) { tbar_->remove_button(button); button_visible_ = false; } + tbar_->remove_task(id_); } bool Task::handle_clicked(GdkEventButton *bt) { From 82b632e4ec1489f9b4446b8c8df6f0a8c59efe3f Mon Sep 17 00:00:00 2001 From: SquishyPandaDev <55671441+SquishyPandaDev@users.noreply.github.com> Date: Mon, 22 Jan 2024 03:22:19 -0500 Subject: [PATCH 2/3] Fix module UPower display device poniter Force displayDevice to be a nullptr on class setup --- include/modules/upower/upower.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/modules/upower/upower.hpp b/include/modules/upower/upower.hpp index eda8ab05..d763259b 100644 --- a/include/modules/upower/upower.hpp +++ b/include/modules/upower/upower.hpp @@ -66,7 +66,7 @@ class UPower : public AModule { Devices devices; std::mutex m_Mutex; UpClient *client; - UpDevice *displayDevice; + UpDevice *displayDevice = nullptr; guint login1_id; GDBusConnection *login1_connection; std::unique_ptr upower_tooltip; From 0af8f5c6910f43cb1bf43bc876a42d16938a6f1e Mon Sep 17 00:00:00 2001 From: Paul Rey Date: Tue, 23 Jan 2024 18:15:47 +0100 Subject: [PATCH 3/3] Add "empty" class for Image module when path/exec is returning an empty value. --- man/waybar-image.5.scd | 1 + src/modules/image.cpp | 2 ++ 2 files changed, 3 insertions(+) diff --git a/man/waybar-image.5.scd b/man/waybar-image.5.scd index 1671e711..e3a69e38 100644 --- a/man/waybar-image.5.scd +++ b/man/waybar-image.5.scd @@ -87,3 +87,4 @@ $path\\n$tooltip # STYLE - *#image* +- *#image.empty* diff --git a/src/modules/image.cpp b/src/modules/image.cpp index 08b03b92..9d59b4a3 100644 --- a/src/modules/image.cpp +++ b/src/modules/image.cpp @@ -63,9 +63,11 @@ auto waybar::modules::Image::update() -> void { } image_.set(pixbuf); image_.show(); + image_.get_style_context()->remove_class("empty"); } else { image_.clear(); image_.hide(); + image_.get_style_context()->add_class("empty"); } AModule::update();