Use a single EventBox to handle group drawer events
Fixes #3029 TODO: contained widgets don't seem to receive any input eventspull/3044/head
parent
cbe42a8536
commit
c41ba10ea6
|
@ -23,6 +23,7 @@ class Group : public AModule {
|
|||
|
||||
protected:
|
||||
Gtk::Box box;
|
||||
Gtk::EventBox event_box;
|
||||
Gtk::Box revealer_box;
|
||||
Gtk::Revealer revealer;
|
||||
bool is_first_widget = true;
|
||||
|
|
|
@ -79,7 +79,9 @@ Group::Group(const std::string& name, const std::string& id, const Json::Value&
|
|||
box.pack_start(revealer);
|
||||
}
|
||||
|
||||
addHoverHandlerTo(revealer);
|
||||
event_box.add(box);
|
||||
event_box.set_above_child(true);
|
||||
addHoverHandlerTo(event_box);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -114,8 +116,6 @@ void Group::addWidget(Gtk::Widget& widget) {
|
|||
getBox().pack_start(widget, false, false);
|
||||
|
||||
if (is_drawer) {
|
||||
// Necessary because of GTK's hitbox detection
|
||||
addHoverHandlerTo(widget);
|
||||
if (!is_first_widget) {
|
||||
widget.get_style_context()->add_class(add_class_to_drawer_children);
|
||||
}
|
||||
|
@ -124,6 +124,6 @@ void Group::addWidget(Gtk::Widget& widget) {
|
|||
is_first_widget = false;
|
||||
}
|
||||
|
||||
Group::operator Gtk::Widget&() { return box; }
|
||||
Group::operator Gtk::Widget&() { return event_box; }
|
||||
|
||||
} // namespace waybar
|
||||
|
|
Loading…
Reference in New Issue