Skip to content

Commit

Permalink
Merge pull request #3 from nsalguero/master
Browse files Browse the repository at this point in the history
Fix volumealsa scroll issue under gtk3
  • Loading branch information
wandrien authored May 9, 2023
2 parents e78def3 + 24b6763 commit 0c44a8a
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions plugins/volumealsa/volumealsa.c
Original file line number Diff line number Diff line change
Expand Up @@ -796,6 +796,17 @@ static void volumealsa_popup_scale_scrolled(GtkScale * scale, GdkEventScroll * e
/* Dispatch on scroll direction to update the value. */
if ((evt->direction == GDK_SCROLL_UP) || (evt->direction == GDK_SCROLL_LEFT))
val += 2;
#if GTK_CHECK_VERSION(3, 0, 0)
else if (evt->direction == GDK_SCROLL_SMOOTH)
{
gdouble delta_x, delta_y;
gdk_event_get_scroll_deltas(evt, &delta_x, &delta_y);
if ((delta_x < 0) || (delta_y < 0))
val += 2;
else
val -= 2;
}
#endif
else
val -= 2;

Expand Down Expand Up @@ -972,6 +983,9 @@ static GtkWidget *volumealsa_constructor(LXPanel *panel, config_setting_t *setti
/* Allocate top level widget and set into Plugin widget pointer. */
vol->panel = panel;
vol->plugin = p = gtk_event_box_new();
#if GTK_CHECK_VERSION(3, 0, 0)
gtk_widget_add_events(p, GDK_SCROLL_MASK);
#endif
vol->settings = settings;
lxpanel_plugin_set_data(p, vol, volumealsa_destructor);
gtk_widget_set_tooltip_text(p, _("Volume control"));
Expand Down

0 comments on commit 0c44a8a

Please sign in to comment.