GNOME Bugzilla – Bug 703675
GtkRecentChooserMenu: gtk_recent_chooser_get_current_uri always returns first item in list
Last modified: 2014-01-24 15:53:08 UTC
Created attachment 248474 [details] testcase to demonstrate bug Overview: An application using gtk-mac-integration 2.0.1 using a GtkRecentChooserMenu in the top menubar does not work properly since the callback associated with the item-activated signal that tries to determine which uri was activated using gtk_recent_chooser_get_current_uri always returns the first uri from the list. It is also noticeably slow at doing so (couple of seconds). The attached example demonstrates the problem. Compile with and without gtk-mac-integration to see the difference. Steps to reproduce: Create a menubar with a submenu. In this submenu, create another submenu and associate it with a GtkRecentChooserMenu created by gtk_recent_chooser_menu_new. Connect the item-activated signal of this GtkRecentChooserMenu with a callback that calls gtk_recent_chooser_get_current_uri Actual results: gtk_recent_chooser_get_current_uri returns always the first uri of the list Expected results: gtk_recent_chooser_get_current_uri should return the correct uri that was activated Platform: 10.8.4 Gtk2: 2.24.19 (installed through macports with +quartz support) gtk-mac-integration 2.0.1 (installed through macports)
Interesting. You get extra points for providing a nice test case. I see why it doesn't work: gtk_recent_chooser_get_current_uri() relies on a private variable called "old_active_menu_item" in the menu that's set by mouse-over. But the quartz menus bypass the gtk_menu so it doesn't get set.
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.