After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 693664 - Scrolling down over a StatusIcon emits lot of "scroll up"
Scrolling down over a StatusIcon emits lot of "scroll up"
Status: RESOLVED NOTABUG
Product: pygobject
Classification: Bindings
Component: introspection
Git master
Other Linux
: Normal normal
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
Depends on:
Blocks:
 
 
Reported: 2013-02-12 17:42 UTC by Jonathan Ballet
Modified: 2014-07-27 13:48 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Test for: scrolling down over a StatusIcon emits lot of "scroll up" (645 bytes, text/plain)
2013-02-12 17:42 UTC, Jonathan Ballet
Details
C example (667 bytes, text/x-csrc)
2014-07-26 01:16 UTC, Simon Feltman
Details
Gjs example (375 bytes, application/javascript)
2014-07-26 01:17 UTC, Simon Feltman
Details

Description Jonathan Ballet 2013-02-12 17:42:24 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.
Comment 1 Simon Feltman 2014-04-28 05:58:35 UTC
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.
Comment 2 Jonathan Ballet 2014-05-01 01:53:56 UTC
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).
Comment 3 Simon Feltman 2014-06-30 16:58:32 UTC
*** Bug 732470 has been marked as a duplicate of this bug. ***
Comment 4 Simon Feltman 2014-07-26 01:16:35 UTC
Created attachment 281744 [details]
C example
Comment 5 Simon Feltman 2014-07-26 01:17:44 UTC
Created attachment 281745 [details]
Gjs example
Comment 6 Simon Feltman 2014-07-26 01:21:35 UTC
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.
Comment 7 Christoph Reiter (lazka) 2014-07-26 11:39:47 UTC
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.
Comment 8 Simon Feltman 2014-07-26 22:54:17 UTC
(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
Comment 9 Peter Levi 2014-07-27 13:48:00 UTC
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.