Skip to content

Commit

Permalink
volume: Hide volume popover after scroll event
Browse files Browse the repository at this point in the history
The timer was not being set for the widget that was scrolled on, only
other widgets that recieved a volume change event externally.
  • Loading branch information
soreau committed Jan 12, 2025
1 parent 7cf7ed7 commit acddcbf
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions src/panel/widgets/volume.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,6 @@ bool WayfireVolume::on_popover_timeout(int timer)
void WayfireVolume::check_set_popover_timeout()
{
popover_timeout.disconnect();
if (this->button->is_popover_focused())
{
return;
}

popover_timeout = Glib::signal_timeout().connect(sigc::bind(sigc::mem_fun(*this,
&WayfireVolume::on_popover_timeout), 0), timeout * 1000);
}
Expand All @@ -123,10 +118,15 @@ void WayfireVolume::set_volume(pa_volume_t volume, set_volume_flags_t flags)
gvc_mixer_stream_push_volume(gvc_stream);
}

if ((flags & VOLUME_FLAG_SHOW_POPOVER) &&
!button->get_popover()->is_visible())
if (flags & VOLUME_FLAG_SHOW_POPOVER)
{
button->get_popover()->popup();
if (!button->get_popover()->is_visible())
{
button->get_popover()->popup();
} else
{
check_set_popover_timeout();
}
}

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

button->grab_focus();
check_set_popover_timeout();
}

void WayfireVolume::on_volume_button_press(GdkEventButton *event)
Expand Down

0 comments on commit acddcbf

Please sign in to comment.