1234567891011121314151617181920212223242526272829303132 |
- diff -ru a/plugins/volumealsa/volumealsa.c b/plugins/volumealsa/volumealsa.c
- --- a/plugins/volumealsa/volumealsa.c 2021-01-29 23:33:27.000000000 +0100
- +++ b/plugins/volumealsa/volumealsa.c 2021-03-21 13:49:00.124807793 +0100
- @@ -794,10 +794,25 @@
- gdouble val = gtk_range_get_value(GTK_RANGE(vol->volume_scale));
-
- /* Dispatch on scroll direction to update the value. */
- - if ((evt->direction == GDK_SCROLL_UP) || (evt->direction == GDK_SCROLL_LEFT))
- + switch (evt->direction)
- + {
- + case GDK_SCROLL_UP: ;
- + case GDK_SCROLL_LEFT: ;
- val += 2;
- - else
- + break;
- + case GDK_SCROLL_DOWN: ;
- + case GDK_SCROLL_RIGHT: ;
- val -= 2;
- + break;
- + case GDK_SCROLL_SMOOTH: ;
- + gdouble delta_x;
- + gdouble delta_y;
- + gdk_event_get_scroll_deltas(evt, &delta_x, &delta_y);
- + if (delta_y > 0)
- + val -= 2;
- + else
- + val += 2;
- + }
-
- /* Reset the state of the vertical scale. This provokes a "value_changed" event. */
- gtk_range_set_value(GTK_RANGE(vol->volume_scale), CLAMP((int)val, 0, 100));
|