GNOME Bugzilla – Bug 693664
Scrolling down over a StatusIcon emits lot of "scroll up"
Last modified: 2014-07-27 13:48:00 UTC
Created attachment 235797 [details] Test for: scrolling down over a StatusIcon emits lot of "scroll up" Scrolling down with the mouse wheel over a Gtk.StatusIcon emits lot of GDK_SCROLL_UP events, about as much as GDK_SCROLL_DOWN events. Scrolling up only emits GDK_SCROLL_UP events. I can't reproduce this using pygtk or using Gtk+ 3 from C on my machine. I'm attaching a script which demonstrates the problem.
I don't get any scroll messages with the example using either pygi or pygtk. My system is Fedora 20 with pygi and GTK+ 3.10. I do recall testing this a while ago on Ubuntu had the problem. Do you still get any scroll messages with later versions of the stack? Also the C example would be helpful if you still have it.
I still have the problem on Debian sid, with: $ python3 -c "import gi; print(gi.version_info)" (3, 12, 1) (or Python 2 as well). I don't have the C example anymore, but it *didn't* show the problem, and that was a really simple C example anyway (which I can't manage to rewrite again).
*** Bug 732470 has been marked as a duplicate of this bug. ***
Created attachment 281744 [details] C example
Created attachment 281745 [details] Gjs example
I've attached both C and Gjs example code which should show the problem. If anyone can test these compared to the Python example it would help. I cannot test these locally due to bug 733770. If the Gjs example exhibits the same problem, then we know the problem is not specific to pygobject and potentially something to do with GI. If we can verify the problem is unique to pygobject then I'll install another desktop to figure this out.
I don't think this is a bug. See https://developer.gnome.org/gdk3/unstable/gdk3-Events.html#gdk-event-get-scroll-direction https://git.gnome.org/browse/gtk+/tree/gdk/gdkevents.c#n1291 The resulting direction is only valid if the first return value is True. In case it returns False, the direction defaults to 0, which happens to be UP. So either check the return value, or use Gdk.Event.direction, which returns GDK_SCROLL_SMOOTH in those cases.
(In reply to comment #7) > I don't think this is a bug. Thanks for figuring that out. I'm guessing if get_scroll_direction() returns False, then you can use get_scroll_deltas() to determine scroll direction/amount. https://developer.gnome.org/gdk3/stable/gdk3-Events.html#gdk-event-get-scroll-deltas
The suggested workaround is of no use for this bug that was marked as duplicate to this one: https://bugzilla.gnome.org/show_bug.cgi?id=732470, and thus it remains unsolved. Please see my additional comments there.