Merge lp:~mterry/libdbusmenu/watch-for-new-items into lp:libdbusmenu/0.5
Status: | Merged | ||||
---|---|---|---|---|---|
Merged at revision: | 206 | ||||
Proposed branch: | lp:~mterry/libdbusmenu/watch-for-new-items | ||||
Merge into: | lp:libdbusmenu/0.5 | ||||
Diff against target: |
189 lines (+85/-12) 1 file modified
libdbusmenu-gtk/parser.c (+85/-12) |
||||
To merge this branch: | bzr merge lp:~mterry/libdbusmenu/watch-for-new-items | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Ted Gould (community) | Approve | ||
Review via email: mp+48644@code.launchpad.net |
Description of the change
This branch does a few things, but most importantly, it watches GtkMenuShells for the addition of new items, fixing bugs where menu items don't appear but should, such as bug 709839.
So, here's what it does:
* Consolidates the creation of new dbusmenu_items into a helper function. There are several things we want to do for each menu item, no matter who creates it, like adding a ParserData object or connecting to its destruction.
* Connect to a new callback to GtkMenuShells ("child-added"). This involves adding a new entry, 'shell' to the ParserData blob.
* Remove a duplicate line from dbusmenu_
* Fix a memory leak when iterating over the children of the topmost GtkMenuShell. It tried to free the list iterator instead of the list itself.
* When adding a new child to a dbusmenu_item, make sure to add it at the right position. This never mattered before, since we did one iteration and were done, but now that we pay attention to insertions, we need to make sure we insert at the correct place.
review approve
Very cool!