Indicator scroll event says direction UP on 12.10 even when scrolling down

Bug #1071738 reported by Peter Levi
96
This bug affects 22 people
Affects Status Importance Assigned to Milestone
pygobject
Expired
Medium
libappindicator (Ubuntu)
Fix Released
Low
Lars Karlitski
Trusty
Fix Released
Undecided
Unassigned
Utopic
Fix Released
Undecided
Unassigned

Bug Description

* Impact
Scrolling on indicators report the wrong scroll event

* Test case
run the program from comment #6, scroll on the indicator, check that the right direction information is outputed

* Regression potentiel
check that scrolling on indicators still work where it used to do something

-------

I am using AppIndicator via Python. On Ubuntu 12.10 (stock install, python-appindicator: Installed: 12.10.0-0ubuntu1) 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.

My application variety depends on this functionality, here is the relevant bug report for it: https://bugs.launchpad.net/variety/+bug/1071598

Here is sample code to demonstrate the problem (OK on 12.04, buggy on 12.10):

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()

Related branches

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in libappindicator (Ubuntu):
status: New → Confirmed
Revision history for this message
Peter Levi (peterlevi) wrote :

Bug also reported here (as the official App Indicators wiki page says this is the proper place for bug-reporting):
https://bugs.launchpad.net/indicator-application/+bug/1075152
Please report there if it affects you.

Revision history for this message
Peter Levi (peterlevi) wrote :

Code snippet above requires this package to be installed: gir1.2-gtk-3.0

Revision history for this message
Peter Levi (peterlevi) wrote :

I reported the bug on Gnome's bugzilla for the pygobject product:
https://bugzilla.gnome.org/show_bug.cgi?id=732470

Let's see if this would make someone pay some attention to this long-standing issue.

Revision history for this message
Peter Levi (peterlevi) wrote :

This comment from a pygobject developer casts more insight and claims the problem is in libappindicator:

https://bugzilla.gnome.org/show_bug.cgi?id=732470#c5

Citing:
"The issue seems to be related to libappindicator using a GI annotation for the
scroll-events direction with (type Gdk.ScrollDirection), whereas the signal is
created using G_TYPE_UINT as the GValue argument type [1]. Emitting
'scroll-event' either with dbus or Python as Christoph has shown passes a
GValue holding an integer. When pygobject receives the signal, it tries to
marshal this GValue as an enum based on the introspection information (using
g_value_get_enum) which is what causes the assertion shown above. Beyond the
assertion warning, g_value_get_enum() also returns 0 which ends up being
GTK_SCROLL_UP (very similar to bug 693664).

We could hack around this in pygobject by also accepting integer types as valid
enum values, but I believe the root of the problem lies in libappindicator
using an annotation which differs in fundamental type than what the signal
describes for its GValue marshaller (G_TYPE_ENUM vs. G_TYPE_UINT).

[1]
http://bazaar.launchpad.net/~indicator-applet-developers/libappindicator/trunk.14.10/view/head:/src/app-indicator.c#L526
"

Revision history for this message
Ofer Chen (oferchen) wrote :

#test python code for gdk scroll direction
#--

#!/usr/bin/python
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()

Revision history for this message
henczati (henczati) wrote :

+1 on Lubuntu/LXDE.

Variety Version: 0.4.20
Desktop Environment: LXDE
OS: Lubuntu 14.04 amd64

$ apt-cache policy gir1.2-appindicator3-0.1 indicator-application indicator-application-gtk2 libappindicator1 libappindicator3-1 libindicator3-7 libindicator7 lxpanel-indicator-applet-plugin | sed '/^[^ ]/ {n;p}; d'
gir1.2-appindicator3-0.1:
  Installed: 12.10.1+13.10.20130920-0ubuntu4
indicator-application:
  Installed: 12.10.1+14.04.20140407-0ubuntu1
indicator-application-gtk2:
  Installed: 12.10.0.1-0ubuntu2
libappindicator1:
  Installed: 12.10.1+13.10.20130920-0ubuntu4
libappindicator3-1:
  Installed: 12.10.1+13.10.20130920-0ubuntu4
libindicator3-7:
  Installed: 12.10.2+14.04.20140402-0ubuntu1
libindicator7:
  Installed: 12.10.2+14.04.20140402-0ubuntu1
lxpanel-indicator-applet-plugin:
  Installed: 0.6.1-0ubuntu3

Lars Karlitski (larsu)
Changed in libappindicator (Ubuntu):
status: Confirmed → In Progress
assignee: nobody → Lars Uebernickel (larsu)
importance: Undecided → Low
Revision history for this message
Sebastien Bacher (seb128) wrote :

Thanks Lars, the fix is landing in vivid and going to be backported to trusty, once verified to be working there

Changed in libappindicator (Ubuntu):
status: In Progress → Fix Committed
Revision history for this message
Peter Levi (peterlevi) wrote :

Thanks again, Lars. Sebastian, any chance to bring this to Utopic as well?

Revision history for this message
Sebastien Bacher (seb128) wrote :

Not sure about utopic, it's a minor issue and we try to limit SRU work on non LTS series...

Revision history for this message
Peter Levi (peterlevi) wrote :

Ok, understood.

Revision history for this message
Sebastien Bacher (seb128) wrote :
Changed in libappindicator (Ubuntu):
status: Fix Committed → Fix Released
description: updated
Revision history for this message
Chris J Arges (arges) wrote : Please test proposed package

Hello Peter, or anyone else affected,

Accepted libappindicator into trusty-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/libappindicator/12.10.1+13.10.20130920-0ubuntu4.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in libappindicator (Ubuntu Trusty):
status: New → Fix Committed
tags: added: verification-needed
Revision history for this message
Chris J Arges (arges) wrote :

Hello Peter, or anyone else affected,

Accepted libappindicator into utopic-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/libappindicator/12.10.1+13.10.20130920-0ubuntu4.2 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in libappindicator (Ubuntu Utopic):
status: New → Fix Committed
Revision history for this message
Alin Andrei (nilarimogard) wrote :

I can confirm that the scroll on indicators now works properly (tested with Variety).

Revision history for this message
Sebastien Bacher (seb128) wrote :

@Alin, thanks, on what Ubuntu serie did you try?

Revision history for this message
Peter Levi (peterlevi) wrote :

I can also confirm the fix works.
Tested on Ubuntu 14.04, in XFCE, LXDE and Cinnamon.

Confirmed that it did NOT work before the upgrade, enabled "proposed" and upgraded, now both Variety and the sample Python code above work as they should. Unfortunately I could not test in Unity, as this is a somewhat broken testing VM and I can't login with Unity. But in this aspect the behavior in Unity used to be consistent with XFCE and the other DEs.

peter@peter-VirtualBox:~$ apt-cache show libappindicator3-1
Package: libappindicator3-1
Priority: optional
Section: libs
Installed-Size: 95
Maintainer: Ubuntu Desktop Team <email address hidden>
Architecture: amd64
Source: libappindicator
Version: 12.10.1+13.10.20130920-0ubuntu4.1

tags: added: verification-done
removed: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package libappindicator - 12.10.1+13.10.20130920-0ubuntu4.1

---------------
libappindicator (12.10.1+13.10.20130920-0ubuntu4.1) trusty; urgency=medium

  * src/app-indicator.c: scroll-event: change parameter to the right type
    (lp: #1071738)
 -- Sebastien Bacher <email address hidden> Tue, 18 Nov 2014 10:39:10 +0100

Changed in libappindicator (Ubuntu Trusty):
status: Fix Committed → Fix Released
Revision history for this message
Scott Kitterman (kitterman) wrote : Update Released

The verification of the Stable Release Update for libappindicator has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package libappindicator - 12.10.1+13.10.20130920-0ubuntu4.2

---------------
libappindicator (12.10.1+13.10.20130920-0ubuntu4.2) utopic; urgency=medium

  * src/app-indicator.c: scroll-event: change parameter to the right type
    (lp: #1071738)
 -- Sebastien Bacher <email address hidden> Tue, 18 Nov 2014 10:39:10 +0100

Changed in libappindicator (Ubuntu Utopic):
status: Fix Committed → Fix Released
Changed in pygobject:
importance: Unknown → Medium
status: Unknown → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.