Skip to content

Commit acddcbf

Browse files
committed
volume: Hide volume popover after scroll event
The timer was not being set for the widget that was scrolled on, only other widgets that recieved a volume change event externally.
1 parent 7cf7ed7 commit acddcbf

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

src/panel/widgets/volume.cpp

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,6 @@ bool WayfireVolume::on_popover_timeout(int timer)
105105
void WayfireVolume::check_set_popover_timeout()
106106
{
107107
popover_timeout.disconnect();
108-
if (this->button->is_popover_focused())
109-
{
110-
return;
111-
}
112-
113108
popover_timeout = Glib::signal_timeout().connect(sigc::bind(sigc::mem_fun(*this,
114109
&WayfireVolume::on_popover_timeout), 0), timeout * 1000);
115110
}
@@ -123,10 +118,15 @@ void WayfireVolume::set_volume(pa_volume_t volume, set_volume_flags_t flags)
123118
gvc_mixer_stream_push_volume(gvc_stream);
124119
}
125120

126-
if ((flags & VOLUME_FLAG_SHOW_POPOVER) &&
127-
!button->get_popover()->is_visible())
121+
if (flags & VOLUME_FLAG_SHOW_POPOVER)
128122
{
129-
button->get_popover()->popup();
123+
if (!button->get_popover()->is_visible())
124+
{
125+
button->get_popover()->popup();
126+
} else
127+
{
128+
check_set_popover_timeout();
129+
}
130130
}
131131

132132
update_icon();
@@ -138,7 +138,6 @@ void WayfireVolume::on_volume_scroll(GdkEventScroll *event)
138138
0.0, max_norm));
139139

140140
button->grab_focus();
141-
check_set_popover_timeout();
142141
}
143142

144143
void WayfireVolume::on_volume_button_press(GdkEventButton *event)

0 commit comments

Comments
 (0)