AppIndicator scroll-event always reports ScrollDirection UP, never DOWN
Submitted by Peter Levi
Link to original bug (#732470)
Description
I am using AppIndicator via Python. On Ubuntu 12.10 and up (14.04 is still affected, not sure about 14.10) when I listen for scroll event signals, the direction is always reported as UP, never as DOWN - even when scrolling down. This was working on 12.04.
This problem seems to be in the Python bindings, as scroll events in appindicators work fine in C and Vala.
My application Variety depends on this functionality, here is the relevant bug report for it: https://bugs.launchpad.net/variety/+bug/1071598 The bug has also been reported here: https://bugs.launchpad.net/indicator-application/+bug/1075152 and here: https://bugs.launchpad.net/ubuntu/+source/libappindicator/+bug/1071738
Here is sample code to demonstrate the problem (OK on Ubuntu 12.04, buggy on 12.10 and up):
from gi.repository import Gtk, Gdk, AppIndicator3
if name == "main": menu = Gtk.Menu() quit = Gtk.MenuItem("Quit") quit.connect("activate", Gtk.main_quit) menu.append(quit) menu.show_all()
def scroll(ind, steps, direction):
print steps, direction
if direction != Gdk.ScrollDirection.UP:
print "Things seem ok"
indicator = AppIndicator3.Indicator.new('testscroll', '', AppIndicator3.IndicatorCategory.APPLICATION_STATUS)
indicator.set_status(AppIndicator3.IndicatorStatus.ACTIVE)
indicator.set_icon("/usr/share/pixmaps/firefox.png")
indicator.connect("scroll-event", scroll)
indicator.set_menu(menu)
Gtk.main()