Menu reordering does not work

Bug #785852 reported by Juho Vuori
38
This bug affects 6 people
Affects Status Importance Assigned to Milestone
DBus Menu
In Progress
Low
Unassigned
GTK+
Expired
Medium
libdbusmenu (Ubuntu)
Confirmed
Low
Unassigned

Bug Description

gtk_menu_reorder_child does nothing on menus managed by application indicator. This is further demonstrated by the two attached C++ programs. Both create a window and a application indicator menu with two items in it and reorder the items. The other attaches the menu to the application indicator icon and the other to a widget on screen. In the first case, the menu gets wrongly rendered in the original ordering. In the second case, the menu gets properly rendered with the two items reordered.

The programs compile on ubuntu 12.04 with some necessary development packages installed:

g++ bugtest.cpp `pkg-config gtkmm-3.0 appindicator3-0.1 --cflags --libs` -o bugtest
g++ bugtest2.cpp `pkg-config gtkmm-3.0 appindicator3-0.1 --cflags --libs` -o bugtest2

Duplicate bug 1026791 also has a Python script to demonstrate the problem. <https://bugs.launchpad.net/libdbusmenu/+bug/1026791/+attachment/3228814/+files/testind.py>

Tags: trusty
Revision history for this message
Juho Vuori (juho-vuori) wrote :
Revision history for this message
Juho Vuori (juho-vuori) wrote :
Changed in indicator-application (Ubuntu):
importance: Undecided → Low
Changed in indicator-application:
importance: Undecided → Low
affects: indicator-application (Ubuntu) → libdbusmenu (Ubuntu)
affects: indicator-application → dbusmenu
Changed in dbusmenu:
status: New → Confirmed
Changed in libdbusmenu (Ubuntu):
status: New → Confirmed
Changed in libdbusmenu (Ubuntu):
assignee: nobody → Michael Terry (mterry)
Revision history for this message
Michael Terry (mterry) wrote :

Hey, thanks for the awesome test cases! I'm looking into this right now. Looks like it's client-side (libappindicator instead of indicator-application) because I can see via d-feet that the menu the test app exports over dbus hasn't changed.

Changed in dbusmenu:
assignee: nobody → Michael Terry (mterry)
status: Confirmed → In Progress
description: updated
Revision history for this message
Michael Terry (mterry) wrote :

This is because gtk_menu_reorder_child does not emit any signals. It just internally reorders its child list and then redraws itself. So to fix this, we'd need to add a new signal to GTK+ to notify us...

Revision history for this message
Michael Terry (mterry) wrote :

And the reason it works in bugtest2 is because it seems like the appmenu waits to create its representation of the menu until the next idle check, so it will see the reordered child list. But libappindicator creates it immediately, before the child list is reordered.

If you change bugtest2 to wait a bit before reordering like below, you'll see the bug there too:

Glib::signal_timeout().connect(sigc::ptr_fun(&timeout_cb), 3000);

So this is a generic problem. We could make it better in some corner cases by delaying until the next idle call, but that won't fix the underlying issue, which is that we don't get notified of reorders.

Revision history for this message
Michael Terry (mterry) wrote :

I reported this upstream to GTK+ (bug has been linked). We'll see what they say about it.

Changed in gtk:
importance: Unknown → Medium
status: Unknown → New
Michael Terry (mterry)
description: updated
Michael Terry (mterry)
Changed in libdbusmenu (Ubuntu):
assignee: Michael Terry (mterry) → nobody
Changed in libdbusmenu:
assignee: Michael Terry (mterry) → nobody
description: updated
tags: added: ubuntu-desktop-trusty
Mathew Hodson (mhodson)
tags: added: trusty
removed: ubuntu-desktop-trusty
Changed in gtk:
status: New → Incomplete
Changed in gtk:
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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