Merge lp:~mterry/appmenu-gtk/misc-fixes into lp:appmenu-gtk/0.4
Status: | Merged |
---|---|
Merged at revision: | 108 |
Proposed branch: | lp:~mterry/appmenu-gtk/misc-fixes |
Merge into: | lp:appmenu-gtk/0.4 |
Diff against target: |
338 lines (+98/-117) 1 file modified
src/bridge.c (+98/-117) |
To merge this branch: | bzr merge lp:~mterry/appmenu-gtk/misc-fixes |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Canonical Desktop Experience Team | Pending | ||
Review via email: mp+47114@code.launchpad.net |
Description of the change
This branch does four things, all observed while working with the monster that is empathy.
1) Empathy changes the first label ("Context", "Contact", or "Group") of it's Edit menu by directly changing the label inside the menu item. So we need to watch for such direct edits as well. (this is the addition of label_notify_cb)
2) Empathy directly hides/shows the first label and first separator in its Edit menu on startup directly. It does not modify the backing GtkAction. So when we startup, we should take such possibilities in mind and prefer the visible/sensitive status of the widget directly over the action -- it is always likely to be more correct (though we should and do continue watching action status).
3) Empathy modifies the first label and separator of its Edit menu upon menu activation (a dynamic menu). We need to listen for about-to-show signals from dbusmenu and activate the menu for empathy, so it can modify the menu. There's a race here, because dbusmenu doesn't yet actually block on our being ready, but it works in practice, and is better than nothing right now.
4) Vastly simplify separator logic. There was existing code to monitor the 'smart' mode and tell when it should be shown. But GtkUIManager handles that for us by setting widget visibility state of the item. So instead, we should treat separators a bit more like normal items. So I attach the same notify callback to separators that were for other widgets before (letting me drop the separate child_notify_cb). This fixes issues in Empathy with showing the first separator in the Edit menu as well as the separators in the Help menu.
We still don't fully get the first label of the Edit menu right -- Empathy is actually setting a submenu. I'm working on another branch that watches the "submenu" property and tries to do intelligent things. But this work was splitable, so here it is.
Oh, whoops, and I forgot, this includes the approved branch https:/ /code.launchpad .net/~mterry/ appmenu- gtk/fix- sensitive- actions/ +merge/ 47056