Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am currently very puzzled why something so simple fails so hard:

This is the source code for a very very simple recent chooser menu, but it fails.

My output is this:

Display name: recentchoosermenu.c
File URI: file:///home/wolf/Downloads/recentchoosermenu.c
Last application: gedit
Display name: recentchoosermenu.c

for every entry, it's always the first file.

I really have no idea why.

Thanks for any help,


EDIT: Well this is embarassing, forgot to append the link:


share|improve this question
Where is the sourcecode? Best is to provide a minimal running example. – Timo Aug 26 '12 at 22:26
Sorry! Would be awesome if you could have a quick look at it! – wolfv Aug 27 '12 at 5:44
I would say this is a bug somewhere (global menu perhaps?). I did some debugging and get the same results in various scenarios. I also found the PyGTK version which you probably ported to PyGI ( and it has the same issue. Some more testing can be done by adding the menu to a Gtk.MenuToolButton for example to see if it really is the menuitem that messes things up. – Timo Aug 27 '12 at 12:04
up vote 1 down vote accepted

Well, it seems that it's a bug in the global menu somewhere. When adding the Gtk.RecentChooserMenu to a Gtk.MenuToolButton or simply disabling the global menu, the problem doesn't occur.

To test, add these two lines to the very top of your code:

import os
os.environ['UBUNTU_MENUPROXY'] = '0'
share|improve this answer
Thanks for investigating this as well :) I will probably write my own "renderer" for the menu, as I can access all the items... – wolfv Aug 27 '12 at 13:07

In case anybody else has problems with *generating a recent chooser menu under ubuntu", here is how I solved it for now:

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.