diff --git a/metadata/panel.xml b/metadata/panel.xml
index 3a1551c8..bba6a96a 100644
--- a/metadata/panel.xml
+++ b/metadata/panel.xml
@@ -415,6 +415,10 @@ If full_span is off, both sides of the panel will take the same amount of space,
show_quick_target
<_name>Show quick action target
+
+ mute_quick_target
+ <_name>Mute quick action target
+
<_short>Middle click action
diff --git a/src/panel/widgets/launchers.cpp b/src/panel/widgets/launchers.cpp
index 296dd6f4..d356fa0c 100644
--- a/src/panel/widgets/launchers.cpp
+++ b/src/panel/widgets/launchers.cpp
@@ -4,7 +4,7 @@
#include
#include
#include
-#include "gtkmm/gestureclick.h"
+#include
#include
#include
#include
diff --git a/src/panel/widgets/mixer/mixer.cpp b/src/panel/widgets/mixer/mixer.cpp
index b4786011..a20f318e 100644
--- a/src/panel/widgets/mixer/mixer.cpp
+++ b/src/panel/widgets/mixer/mixer.cpp
@@ -50,7 +50,15 @@ void WayfireMixer::reload_config()
// "actions" that can be bound to different clicks
auto show_mixer_action = [&] (int c, double x, double y)
{
- if (button->get_popup_child() != (Gtk::Widget*)&master_box)
+ if ((button->get_popup_child() == &master_box) && button->is_popup_visible())
+ {
+ button->popdown();
+ return;
+ }
+
+ button->popup();
+
+ if (button->get_popup_child() != &master_box)
{
button->set_popup_child(master_box);
}
@@ -58,7 +66,6 @@ void WayfireMixer::reload_config()
auto show_quick_target_action = [&] (int c, double x, double y)
{
- // unschedule hiding
if (!quick_target)
{
return; // no quick_target means we have nothing to show
@@ -70,10 +77,7 @@ void WayfireMixer::reload_config()
return;
}
- if (!button->is_popup_visible())
- {
- button->popup();
- }
+ button->popup();
if (button->get_popup_child() != quick_target.get())
{
@@ -93,7 +97,6 @@ void WayfireMixer::reload_config()
if (str_wp_left_click_action.value() == "show_mixer")
{
- button->open_on(1);
left_conn = left_click_gesture->signal_released().connect(show_mixer_action);
}
@@ -109,7 +112,6 @@ void WayfireMixer::reload_config()
if (str_wp_middle_click_action.value() == "show_mixer")
{
- button->open_on(3);
middle_conn = middle_click_gesture->signal_released().connect(show_mixer_action);
}
@@ -125,7 +127,6 @@ void WayfireMixer::reload_config()
if (str_wp_right_click_action.value() == "show_mixer")
{
- button->open_on(2);
right_conn = right_click_gesture->signal_released().connect(show_mixer_action);
}
@@ -161,7 +162,7 @@ void WayfireMixer::init(Gtk::Box *container)
button->add_css_class("widget-icon");
button->append(main_image);
button->show();
- button->open_on(1);
+ button->open_on(-1); // the gestures callback will take care of opening and closing
sinks_box.add_css_class("outputs");
sources_box.add_css_class("inputs");
streams_box.add_css_class("streams");
diff --git a/src/panel/widgets/volume.cpp b/src/panel/widgets/volume.cpp
index 19697897..e99bdf87 100644
--- a/src/panel/widgets/volume.cpp
+++ b/src/panel/widgets/volume.cpp
@@ -1,9 +1,7 @@
#include
#include
+
#include "volume.hpp"
-#include "glib.h"
-#include "glibmm/main.h"
-#include "gtkmm/gesture.h"
#include "icon-select.hpp"
#include "wf-popover.hpp"
diff --git a/src/panel/widgets/window-list/toplevel.cpp b/src/panel/widgets/window-list/toplevel.cpp
index b83ff827..d4a0a916 100644
--- a/src/panel/widgets/window-list/toplevel.cpp
+++ b/src/panel/widgets/window-list/toplevel.cpp
@@ -10,8 +10,6 @@
#include
#include "toplevel.hpp"
-#include "gtkmm/enums.h"
-#include "gtkmm/gesture.h"
#include "window-list.hpp"
#include "gtk-utils.hpp"
diff --git a/src/util/wf-popover.cpp b/src/util/wf-popover.cpp
index 92d7eefb..63b0f6fe 100644
--- a/src/util/wf-popover.cpp
+++ b/src/util/wf-popover.cpp
@@ -1,19 +1,11 @@
-#include "wf-popover.hpp"
-#include "giomm/menumodel.h"
-#include "glib.h"
-#include "glibmm.h"
-#include "glibmm/main.h"
-#include "gtk/gtk.h"
-#include "gtkmm/eventcontrollermotion.h"
-#include "gtkmm/gestureclick.h"
-#include "gtkmm/widget.h"
-#include "wf-autohide-window.hpp"
#include
#include
-#include
#include
#include
+#include "wf-popover.hpp"
+#include "wf-autohide-window.hpp"
+
/* Helper to get panel from button. NULL if not added to one */
WayfireAutohidingWindow *get_panel(Gtk::Widget *button)
{
@@ -299,7 +291,14 @@ void WayfireMenuWidget::set_popup_child(Gtk::Widget & widget)
Gtk::Widget*WayfireMenuWidget::get_popup_child()
{
- return popover.get_child();
+ auto child = scroll.get_child();
+ // the scrollable window wraps the child given to it in a viewport if it is not scrollable
+ if (auto *viewport = dynamic_cast(child))
+ {
+ return viewport->get_child();
+ }
+
+ return child;
}
void WayfireMenuWidget::toggle()
diff --git a/src/util/wf-popover.hpp b/src/util/wf-popover.hpp
index 19b22e9a..cc967026 100644
--- a/src/util/wf-popover.hpp
+++ b/src/util/wf-popover.hpp
@@ -1,16 +1,11 @@
#pragma once
-#include "giomm/menumodel.h"
-#include "glibmm/refptr.h"
-#include "gtkmm/gestureclick.h"
-#include "gtkmm/scrolledwindow.h"
-#include
+#include
+#include
+#include
+
#include
#include
-#include
-#include
-#include
-#include
#include
#include