From 7df266cbd0890e9630b1e4052416c0e454303c07 Mon Sep 17 00:00:00 2001 From: hrdl <31923882+hrdl-github@users.noreply.github.com> Date: Tue, 19 Mar 2024 23:11:03 +0100 Subject: [PATCH] Use existing event_box_ member. event_box_.set_above_child(true) prevents the child modules/widgets from receiving any events. Without it the group module registers NOTIFY_LEAVE events when a child widget is entered. I'm unsure why these events don't get propagated. The widgets' event masks look correct when printing, but the event handlers remain connected. --- include/group.hpp | 2 -- src/group.cpp | 8 +++----- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/include/group.hpp b/include/group.hpp index d90ec6d6..d02f88d5 100644 --- a/include/group.hpp +++ b/include/group.hpp @@ -14,7 +14,6 @@ class Group : public AModule { Group(const std::string&, const std::string&, const Json::Value&, bool); virtual ~Group() = default; auto update() -> void override; - operator Gtk::Widget&() override; virtual Gtk::Box& getBox(); void addWidget(Gtk::Widget& widget); @@ -23,7 +22,6 @@ class Group : public AModule { protected: Gtk::Box box; - Gtk::EventBox event_box; Gtk::Box revealer_box; Gtk::Revealer revealer; bool is_first_widget = true; diff --git a/src/group.cpp b/src/group.cpp index a31e22af..31c4ed6c 100644 --- a/src/group.cpp +++ b/src/group.cpp @@ -79,10 +79,10 @@ Group::Group(const std::string& name, const std::string& id, const Json::Value& box.pack_start(revealer); } - event_box.add(box); - event_box.set_above_child(true); - addHoverHandlerTo(event_box); + event_box_.set_above_child(true); + addHoverHandlerTo(event_box_); } + event_box_.add(box); } bool Group::handleMouseHover(GdkEventCrossing* const& e) { @@ -124,6 +124,4 @@ void Group::addWidget(Gtk::Widget& widget) { is_first_widget = false; } -Group::operator Gtk::Widget&() { return event_box; } - } // namespace waybar