unity-gtk-module does not respect "ubuntu-local" property (used by e.g. Freeciv) as appmenu-gtk did

Bug #1242937 reported by Jacob Nevins
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Unity GTK+ module
Fix Committed
Medium
William Hua
unity-gtk-module (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

The pre-13.10 global menu arrangement (appmenu-gtk?) allowed applications to suppress the "global menu" behaviour (where menubars move to the top of the screen) by decorating menubars with a Gtk property called "ubuntu-local".

Freeciv has several menubars that do not make sense to be global menus, and so decorates them with "ubuntu-local" (see LP #743265).

The new arrangement in Ubuntu 13.10, involving unity-gtk-module, does not appear to respect the "ubuntu-local" property. All menubars are indiscriminately hoisted up to the global menu, resulting in a mess. Screenshot (taken by attente): http://imgur.com/HzJQ0Yq (here the menu buttons "Diplomacy", "Intelligence", "Display", "AI" should all be at the bottom of the "Nations" tab in the notebook).

Related branches

William Hua (attente)
Changed in unity-gtk-module:
assignee: nobody → William Hua (attente)
Revision history for this message
Jacob Nevins (0jacobnk-ulp) wrote :

For reference, the code we use in Freeciv to decorate our menubars post bug #743265:

  /**************************************************************************
    Create an auxiliary menubar (i.e., not the main menubar at the top of
    the window).
  **************************************************************************/
  GtkWidget *gtk_aux_menu_bar_new(void) {
    GtkWidget *menubar = gtk_menu_bar_new();

    if (g_object_class_find_property(
          G_OBJECT_CLASS(GTK_MENU_BAR_GET_CLASS(menubar)), "ubuntu-local")) {
      g_object_set(G_OBJECT(menubar), "ubuntu-local", TRUE, NULL);
    }

    return menubar;
  }

Revision history for this message
Jacob Nevins (0jacobnk-ulp) wrote :

(attente said on IRC to assign this bug to them, but either I don't have privileges to do so, or I just can't drive Launchpad.)

Revision history for this message
William Hua (attente) wrote :

Hi Jacob, I looked at this a bit more and it seems like it won't be possible to fix this bug using ubuntu-local (this would require a distro patch on GTK+ to support). If I could propose an alternate solution, we could instead try to blacklist freeciv from having global menus entirely (the same effect as specifying UBUNTU_MENUPROXY= on the command line).

Revision history for this message
William Hua (attente) wrote :

The downside is that the main application menu bar will not appear in the global menu....

Revision history for this message
Jacob Nevins (0jacobnk-ulp) wrote :

> this would require a distro patch on GTK+ to support

I assume that's undesirable for some reason.

> we could instead try to blacklist freeciv from having global menus
> entirely (the same effect as specifying UBUNTU_MENUPROXY=
> on the command line).

Well, that would clearly solve the problem.

In your patch, you catch names "freeciv" and "freeciv-gtk2". Is the former necessary?
Also, I suggest you include "freeciv-gtk3" -- this is a new client in 2.4.x, using the Gtk3 toolkit, but it uses menubars in the same way so I expect it would suffer the same issue (although I haven't tested it).

> The downside is that the main application menu bar will not
> appear in the global menu....

Indeed.
I assume this is fairly hard to revert? -- that is, if some future change in Freeciv somehow renders it compatible with globalmenu, there's no way for users or Freeciv itself to override the blacklisting? (And if you remove it from unity-gtk-module, then users of older versions of Freeciv will once again see breakage. So it's hard to coordinate outside of the Ubuntu-packaged Freeciv version.)

Charles Kerr (charlesk)
Changed in unity-gtk-module:
status: New → In Progress
importance: Undecided → Medium
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

Fix committed into lp:unity-gtk-module at revision None, scheduled for release in unity-gtk-module, milestone Unknown

Changed in unity-gtk-module:
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in unity-gtk-module (Ubuntu):
status: New → Confirmed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package unity-gtk-module - 0.0.0+14.04.20131125-0ubuntu1

---------------
unity-gtk-module (0.0.0+14.04.20131125-0ubuntu1) trusty; urgency=low

  [ Charles Kerr ]
  * Add acroread to the blacklist. (LP: #664647)

  [ William Hua ]
  * Freeciv uses multiple menu bars in its UI. When unity-gtk-module
    tries to export its menus, it becomes really cramped in the global
    menu to the point of being unusable. It's better to allow Freeciv to
    keep its menus where they are in this case. (LP: #1242937)
  * Add a GSettings schema that allows the user to set a blacklist and
    whitelist for unity-gtk-module (LP: #1243413). (LP: #1243413)

  [ Ubuntu daily release ]
  * Automatic snapshot from revision 308
 -- Ubuntu daily release <email address hidden> Mon, 25 Nov 2013 03:55:07 +0000

Changed in unity-gtk-module (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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