Merge lp:~3v1n0/libdbusmenu/really-recreate-menu into lp:libdbusmenu/14.10

Proposed by Marco Trevisan (Treviño) on 2014-06-07
Status: Merged
Approved by: Charles Kerr on 2014-06-09
Approved revision: 472
Merged at revision: 472
Proposed branch: lp:~3v1n0/libdbusmenu/really-recreate-menu
Merge into: lp:libdbusmenu/14.10
Diff against target: 11 lines (+1/-0)
1 file modified
libdbusmenu-gtk/parser.c (+1/-0)
To merge this branch: bzr merge lp:~3v1n0/libdbusmenu/really-recreate-menu
Reviewer Review Type Date Requested Status
Charles Kerr (community) 2014-06-07 Approve on 2014-06-09
PS Jenkins bot (community) continuous-integration Approve on 2014-06-07
Review via email: mp+222419@code.launchpad.net

Commit message

Parser: make sure that the old dbus menuitem is detached from the widget before recreating

When a dbus menuitem has to be recreated, we need to disconnect the widget from it, or
the old one will be reused at next parsing cycle.

Description of the change

Although libdbusmenu was supposed to recreate menus when a label was initially set, it actually was not doing that since we were not resetting the old menuitem, and then we were reusing it instead of creating a new one.

Test case: http://pastebin.ubuntu.com/7604811/

To post a comment you must log in.
Charles Kerr (charlesk) wrote :

Treviño, nice job tracking this down and providing the test case.

The one-liner looks sane and fixes the sample you provided, Approve :-)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'libdbusmenu-gtk/parser.c'
2--- libdbusmenu-gtk/parser.c 2013-12-13 15:29:58 +0000
3+++ libdbusmenu-gtk/parser.c 2014-06-07 00:04:51 +0000
4@@ -987,6 +987,7 @@
5 GtkWidget * menuitem = pdata->widget;
6
7 dbusmenu_menuitem_child_delete (parent, child);
8+ disconnect_from_widget (menuitem);
9
10 RecurseContext recurse = {0};
11 recurse.toplevel = gtk_widget_get_toplevel(menuitem);

Subscribers

People subscribed via source and target branches