Merge lp:~om26er/ubuntu/maverick/appmenu-gtk/appmenu-gtk-fix-655241 into lp:ubuntu/maverick/appmenu-gtk

Proposed by Omer Akram on 2010-11-20
Status: Merged
Merge reported by: Sebastien Bacher
Merged at revision: not available
Proposed branch: lp:~om26er/ubuntu/maverick/appmenu-gtk/appmenu-gtk-fix-655241
Merge into: lp:ubuntu/maverick/appmenu-gtk
Diff against target: 148 lines (+135/-0)
2 files modified
debian/changelog (+7/-0)
debian/patches/do_not_show_duplicate_menus.patch (+128/-0)
To merge this branch: bzr merge lp:~om26er/ubuntu/maverick/appmenu-gtk/appmenu-gtk-fix-655241
Reviewer Review Type Date Requested Status
Michael Vogt 2010-11-20 Approve on 2010-11-22
Review via email: mp+41397@code.launchpad.net

Description of the Change

backporting the fix from upstream trunk

To post a comment you must log in.
Michael Vogt (mvo) wrote :
Michael Vogt (mvo) wrote :

Heh, looks like we add the ref to the upstream branch at almost the same time :) Looks fine, I prepare the upload now.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2010-09-30 18:24:53 +0000
3+++ debian/changelog 2010-11-20 14:01:18 +0000
4@@ -1,3 +1,10 @@
5+appmenu-gtk (0.1.9-0ubuntu4.1) maverick-proposed; urgency=low
6+
7+ * debian/patches/do_not_show_duplicate_menus.patch:
8+ - do not show duplicate menu items (LP: #655241)
9+
10+ -- Omer Akram <om26er@ubuntu.com> Sat, 20 Nov 2010 15:28:43 +0500
11+
12 appmenu-gtk (0.1.9-0ubuntu4) maverick; urgency=low
13
14 * cherry-picked from upstream:
15
16=== added directory 'debian/patches'
17=== added file 'debian/patches/do_not_show_duplicate_menus.patch'
18--- debian/patches/do_not_show_duplicate_menus.patch 1970-01-01 00:00:00 +0000
19+++ debian/patches/do_not_show_duplicate_menus.patch 2010-11-20 14:01:18 +0000
20@@ -0,0 +1,128 @@
21+=== modified file 'src/bridge.c'
22+--- src/bridge.c 2010-09-29 17:14:35 +0000
23++++ src/bridge.c 2010-10-06 16:52:47 +0000
24+@@ -696,6 +696,33 @@
25+ }
26+ }
27+
28++/*
29++ * We probably should have added a 'remove' method to the UbuntuMenuProxy early on,
30++ * but it's late in the cycle now.
31++ */
32++static void
33++child_notify_cb (GtkWidget *widget,
34++ GParamSpec *pspec,
35++ DbusmenuMenuitem *mi)
36++{
37++ if (pspec->name == g_intern_static_string ("parent"))
38++ {
39++ if (gtk_widget_get_parent (widget) == NULL)
40++ {
41++ g_signal_handlers_disconnect_by_func (widget,
42++ G_CALLBACK (child_notify_cb),
43++ mi);
44++
45++ DbusmenuMenuitem *parent = g_object_get_data (G_OBJECT (mi), "dbusmenu-parent");
46++
47++ if (DBUSMENU_IS_MENUITEM (parent) && DBUSMENU_IS_MENUITEM (mi))
48++ {
49++ dbusmenu_menuitem_child_delete (parent, mi);
50++ }
51++ }
52++ }
53++}
54++
55+ static DbusmenuMenuitem *
56+ construct_dbusmenu_for_widget (GtkWidget *widget, gboolean previous_separator)
57+ {
58+@@ -718,6 +745,7 @@
59+ else
60+ {
61+ gboolean visible = FALSE;
62++ gboolean sensitive = FALSE;
63+ gboolean label_set = FALSE;
64+
65+ g_signal_connect (widget,
66+@@ -776,16 +804,9 @@
67+ if (!g_object_get_data (G_OBJECT (widget), "gtk-empty-menu-item") && !GTK_IS_TEAROFF_MENU_ITEM (widget))
68+ {
69+ visible = gtk_widget_get_visible (widget);
70++ sensitive = gtk_widget_get_sensitive (widget);
71+ }
72+
73+- dbusmenu_menuitem_property_set_bool (mi,
74+- DBUSMENU_MENUITEM_PROP_VISIBLE,
75+- visible);
76+-
77+- dbusmenu_menuitem_property_set_bool (mi,
78+- DBUSMENU_MENUITEM_PROP_ENABLED,
79+- gtk_widget_get_sensitive (widget));
80+-
81+ dbusmenu_menuitem_property_set_shortcut_menuitem (mi, GTK_MENU_ITEM (widget));
82+
83+ g_signal_connect (G_OBJECT (widget),
84+@@ -803,6 +824,9 @@
85+
86+ if (action)
87+ {
88++ visible = gtk_action_is_visible (action);
89++ sensitive = gtk_action_is_sensitive (action);
90++
91+ g_signal_connect_object (action, "notify",
92+ G_CALLBACK (action_notify_cb),
93+ mi,
94+@@ -811,11 +835,24 @@
95+ }
96+ }
97+
98++ dbusmenu_menuitem_property_set_bool (mi,
99++ DBUSMENU_MENUITEM_PROP_VISIBLE,
100++ visible);
101++
102++ dbusmenu_menuitem_property_set_bool (mi,
103++ DBUSMENU_MENUITEM_PROP_ENABLED,
104++ sensitive);
105++
106+ g_signal_connect (G_OBJECT (mi),
107+ DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED,
108+ G_CALLBACK (item_activated),
109+ widget);
110+ }
111++
112++ g_signal_connect (widget,
113++ "notify",
114++ G_CALLBACK (child_notify_cb),
115++ mi);
116+ }
117+
118+ return mi;
119+@@ -947,6 +984,9 @@
120+
121+ if (!peek)
122+ {
123++ g_object_set_data (G_OBJECT (recurse->stack[recurse->count]),
124++ "dbusmenu-parent",
125++ recurse->stack[recurse->count - 1]);
126+ dbusmenu_menuitem_child_append (recurse->stack[recurse->count - 1],
127+ recurse->stack[recurse->count]);
128+ }
129+@@ -967,6 +1007,10 @@
130+
131+ if (!peek)
132+ {
133++ g_object_set_data (G_OBJECT (recurse->stack[recurse->count]),
134++ "dbusmenu-parent",
135++ recurse->stack[recurse->count - 1]);
136++
137+ dbusmenu_menuitem_child_append (item, recurse->stack[recurse->count]);
138+ }
139+ }
140+@@ -1290,6 +1334,7 @@
141+ {
142+ DbusmenuMenuitem *child_dmi = construct_dbusmenu_for_widget (child, FALSE);
143+
144++ g_object_set_data (G_OBJECT (child_dmi), "dbusmenu-parent", mi);
145+ dbusmenu_menuitem_child_add_position (mi,
146+ child_dmi,
147+ position);
148+

Subscribers

People subscribed via source and target branches

to all changes: