~attente/unity-gtk-module/1294947-fix-mnemonics

Viewing all changes in revision 312.

  • Committer: Tarmac
  • Author(s): William Hua
  • Date: 2013-12-13 17:42:54 UTC
  • mfrom: (309.3.2 1198471)
  • Revision ID: tarmac-20131213174254-ttq7v9gl4u00b7s7
Relax the preconditions for disconnecting action groups from shells. (LP: #1198471)

If we have this situation:

  Menu A (action group G)
    Menu B (action group G)
      Menu C (action group G) <- about to be destroyed
        Menu D (action group G)
          Menu E (action group G)

and Menu C is destroyed, we get:

  Menu A (action group G)
    Menu B (action group G)
      Menu C (no action group)
        Menu D (no action group)
          Menu E (no action group)

So when Menu A is disconnected from G, this causes the warnings from LP: #1198471.

One thing we could have tried was just removing the tree rooted at Menu C, but then that would break removing the entire tree rooted at Menu A. Also, we'd have to end up doing this by having the Menu C unref itself.

It's really easiest to treat it as a dead sub-tree that will be finalized when the entire tree is finalized. Let's relax the preconditions on the unity_gtk_action_group_disconnect_item and unity_gtk_action_group_disconnect_shell functions, and allow the case where the shell's action group is already set to NULL. Fixes: https://bugs.launchpad.net/bugs/1198471.

Approved by Lars Uebernickel, PS Jenkins bot.

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: