setting an image multiple times on a gtk.ImageMenuItem fails in python-appindicator

Bug #934574 reported by Thomi Richards
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
DBus Menu
Fix Released
Medium
Ted Gould

Bug Description

I'm using python-appindicator and pygtk2.

I'm writing an application where I occaisonally want to update the images in a
gtk.ImageMenuItem. The images represent the current state of a job, and my code
polls the running jobs, and updates the menu entry images accordingly.

I've noticed that if you set the same image twice consecutively, the
ImageMenuItem will not display any image at all. I.e.- if you have two images:
"img_A" and "img_B", doing this:

menu_item.set_image(img_A)
...
menu_item.set_image(img_B)
...
menu_item.set_image(img_A)
...
menu_item.set_image(img_B)

... will do what you expect. However, if you do this:

menu_item.set_image(img_B)
...
menu_item.set_image(img_B)

The image will dissapear when the second set_image call is made.

Attached is a python script that demonstrates the problem. There are two versions:

gtk-menu-bug-with-appindicator.py reproduces the issue. It creates an entry
in the panel / status bar with a menu attached. Initially the first menu entry
will have a "red ball" image next to it. 5 seconds later this image is updated
to a "green ball" image. 5 seconds after that we try and update the image to
the "green ball" image again, and the image dissapears from the menu.

gtk-menu-bug.py does the same thing, but without the appindicator (it draws a gtk popup menu instead). This version does not suffer from the same issue.

Related branches

Revision history for this message
Thomi Richards (thomir-deactivatedaccount) wrote :
Ted Gould (ted)
affects: libappindicator → dbusmenu
Changed in dbusmenu:
assignee: nobody → Ted Gould (ted)
importance: Undecided → Medium
status: New → In Progress
Ted Gould (ted)
Changed in dbusmenu:
status: In Progress → Fix Released
milestone: none → 0.5.93
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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