After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 703675 - GtkRecentChooserMenu: gtk_recent_chooser_get_current_uri always returns first item in list
GtkRecentChooserMenu: gtk_recent_chooser_get_current_uri always returns first...
Status: RESOLVED FIXED
Product: gtk-osx
Classification: Other
Component: General
unspecified
Other Mac OS
: Normal normal
: ---
Assigned To: GTK Mac Integration Maintainers
GTK Mac Integration Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-07-05 18:26 UTC by Tom Schoonjans
Modified: 2014-01-24 15:53 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
testcase to demonstrate bug (2.31 KB, application/octet-stream)
2013-07-05 18:26 UTC, Tom Schoonjans
Details

Description Tom Schoonjans 2013-07-05 18:26:47 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)
Comment 1 John Ralls 2013-07-06 21:01:21 UTC
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.
Comment 2 John Ralls 2013-07-14 23:16:27 UTC
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.