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 696425 - gedit fails to display fallback application menu items
gedit fails to display fallback application menu items
Status: RESOLVED FIXED
Product: gedit
Classification: Applications
Component: general
3.7.x
Other Linux
: Normal major
: ---
Assigned To: Gedit maintainers
Gedit maintainers
Depends on:
Blocks:
 
 
Reported: 2013-03-22 21:35 UTC by Adam Dingle
Modified: 2013-03-25 08:02 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
app menu (4.30 KB, patch)
2013-03-22 21:54 UTC, Ignacio Casal Quinteiro (nacho)
none Details | Review
patch (1.34 KB, patch)
2013-03-24 17:41 UTC, Paolo Borelli
none Details | Review

Description Adam Dingle 2013-03-22 21:35:20 UTC
gedit contains code which attempts to display fallback menu items in environments in which the shell does not display an application menu, i.e. when gtk-shell-shows-app-menu is false.  Unfortunately currently this fails: when I run gedit 3.7.6 on Ubuntu 13.04 (Raring) under Unity, the application menu items (Edit->Preferences, Help->About and so on) are missing.

I investigated by stepping through in a debugger. The problem is that _gedit_app_has_app_menu() returns true, so the code in create_menu_bar_and_toolbar() which is supposed to add the fallback items never runs.  I *believe* the problem is that _gedit_app_has_app_menu() queries the default GTK settings rather the settings for the screen we are on.  In other words, both Nautilus and Epiphany do this (which works, returning false under Unity):

	settings = gtk_settings_get_for_screen (gtk_widget_get_screen (GTK_WIDGET (window)));
	g_object_get (settings,
		      "gtk-shell-shows-app-menu", &shows_app_menu,
		      NULL);

But currently gedit does this (in _gedit_app_has_app_menu):

	gtk_settings = gtk_settings_get_default ();
	g_object_get (G_OBJECT (gtk_settings),
	              "gtk-shell-shows-app-menu",
	              &show_app_menu,
	              NULL);
Comment 1 Ignacio Casal Quinteiro (nacho) 2013-03-22 21:54:17 UTC
Created attachment 239582 [details] [review]
app menu

Thanks Adam, I guess something like this would do it. Mind to test it?
Comment 2 Adam Dingle 2013-03-23 01:44:41 UTC
Thanks for the quick turnaround!

Unfortunately this patch does not help.  :(  I now believe I was wrong when I thought we needed to query settings for the screen we're on.  Indeed, with this patch gtk-shell-shows-app-menu still evaluates to TRUE.  I stepped through the corresponding code in Epiphany and found that gtk-shell-shows-app-menu is TRUE there too!

So it appears that Unity actually *can* display the app menu, and does so correctly with Epiphany and Nautilus, but fails to display the app menu in gedit.  Perhaps that's because the app menu is the only top-level menu in Epiphany and Nautilus, but gedit has other top-level menus too, which might confuse Unity?  If that's true then presumably this would be a Unity bug.  I'll try to see if I get can someone from Ubuntu to look at this and/or comment.
Comment 3 Adam Dingle 2013-03-23 02:21:14 UTC
I created an Ubuntu bug at

https://bugs.launchpad.net/ubuntu/+source/gedit/+bug/1159036
Comment 4 Allison Karlitskaya (desrt) 2013-03-24 17:13:00 UTC
I think the problem is that ubuntu _does_ set ShellShowsAppMenu to true (since it does).

It also sets ShellShowsMenubar to true, though....

I've advised people in the past that the better thing to do in this case is to check if shell-shows-appmenu != shell-shows-menubar

ie:

  - on GNOME 2, both are false:     show old menus
  - on GNOME 3, only one is true:   show new style
  - on Unity, both are true:        show old menus

so you should show the gnome2-style menu layout in any case where the two are equal.
Comment 5 Paolo Borelli 2013-03-24 17:41:36 UTC
Created attachment 239689 [details] [review]
patch

This implements Ryan's suggestion. Works as expected with gnome-shell and metacity.

Could you guys test it with Unity?
Comment 6 Lars Karlitski 2013-03-24 20:36:25 UTC
Works as expected with Unity, thanks Paolo!
Comment 7 Paolo Borelli 2013-03-25 08:02:54 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.