Merge lp:~mterry/gtk/ubuntu-f10 into lp:~ubuntu-desktop/gtk/ubuntu

Proposed by Michael Terry on 2011-01-21
Status: Merged
Merge reported by: Michael Terry
Merged at revision: not available
Proposed branch: lp:~mterry/gtk/ubuntu-f10
Merge into: lp:~ubuntu-desktop/gtk/ubuntu
Diff against target: 273 lines (+89/-36) 3 files modified
To merge this branch: bzr merge lp:~mterry/gtk/ubuntu-f10
Reviewer Review Type Date Requested Status
Ubuntu Desktop 2011-01-21 Pending
Review via email: mp+47044@code.launchpad.net

Description of the Change

This fixes the issue where F10 wouldn't activate the global menu, but instead activated the hidden local menu. I'm proposing a merge because this is code I'm not used to touching.

To post a comment you must log in.
Cody Russell (bratsche) wrote :

I haven't tested it, but the code looks fine to me.

Preview Diff

1=== modified file 'debian/changelog'
2--- debian/changelog 2011-01-19 10:44:49 +0000
3+++ debian/changelog 2011-01-21 14:45:14 +0000
4@@ -1,12 +1,19 @@
5 gtk+2.0 (2.23.90-0ubuntu5) UNRELEASED; urgency=low
6
7+ [ Sebastien Bacher ]
8 * debian/patches/093_gtk3_gtkimage_fallbacks_use.patch:
9 - backported gtk3 patch to add a "use-fallback" property to GtkImage, using
10 it "icon-name and GIcon type of GtkImages can use automatic fallback
11 names.", it will be useful for the indicator stack
12 (lp: #704632)
13
14- -- Sebastien Bacher <seb128@ubuntu.com> Wed, 19 Jan 2011 11:38:31 +0100
15+ [ Michael Terry ]
16+ * debian/patches/043_ubuntu_menu_proxy.patch:
17+ - Update to proxy F10 presses to the global menu. LP: #689178
18+ * debian/libgtk2.0-0.symbols:
19+ - Add new symbol ubuntu_gtk_menu_shell_activate_first
20+
21+ -- Michael Terry <mterry@ubuntu.com> Fri, 21 Jan 2011 09:25:45 -0500
22
23 gtk+2.0 (2.23.90-0ubuntu4) natty; urgency=low
24
25
26=== modified file 'debian/libgtk2.0-0.symbols'
27--- debian/libgtk2.0-0.symbols 2011-01-12 17:48:54 +0000
28+++ debian/libgtk2.0-0.symbols 2011-01-21 14:45:14 +0000
29@@ -4726,6 +4726,7 @@
30 gtk_window_unstick@Base 2.8.0
31 gtk_wrap_mode_get_type@Base 2.8.0
32 hildon_gtk_file_chooser_install_properties@Base 2.10.0
33+ ubuntu_gtk_menu_shell_activate_first@Base 2.23.90-0ubuntu4
34 ubuntu_gtk_menu_shell_activate_mnemonic@Base 2.21.6-1ubuntu5.1
35 ubuntu_gtk_widget_set_has_grab@Base 2.21.6-1ubuntu3
36 ubuntu_menu_proxy_activate_menu@Base 2.21.6-1ubuntu5.1
37
38=== modified file 'debian/patches/043_ubuntu_menu_proxy.patch'
39--- debian/patches/043_ubuntu_menu_proxy.patch 2011-01-07 02:18:53 +0000
40+++ debian/patches/043_ubuntu_menu_proxy.patch 2011-01-21 14:45:14 +0000
41@@ -1,10 +1,10 @@
42 ## Description: add some description
43 ## Origin/Author: add some origin or author
44 ## Bug: bug URL
45-Index: gtk+-2.23.90/gtk/Makefile.am
46+Index: gtk+2.0-2.23.90/gtk/Makefile.am
47 ===================================================================
48---- gtk+-2.23.90.orig/gtk/Makefile.am 2011-01-07 12:30:17.493891001 +1100
49-+++ gtk+-2.23.90/gtk/Makefile.am 2011-01-07 12:30:34.383891001 +1100
50+--- gtk+2.0-2.23.90.orig/gtk/Makefile.am 2011-01-21 09:23:55.728241188 -0500
51++++ gtk+2.0-2.23.90/gtk/Makefile.am 2011-01-21 09:23:58.638179868 -0500
52 @@ -249,6 +249,8 @@
53 gtkmenu.h \
54 gtkmenubar.h \
55@@ -23,10 +23,10 @@
56 gtkmenushell.c \
57 gtkmenutoolbutton.c \
58 gtkmessagedialog.c \
59-Index: gtk+-2.23.90/gtk/gtk.h
60+Index: gtk+2.0-2.23.90/gtk/gtk.h
61 ===================================================================
62---- gtk+-2.23.90.orig/gtk/gtk.h 2011-01-07 04:15:12.000000000 +1100
63-+++ gtk+-2.23.90/gtk/gtk.h 2011-01-07 12:30:34.383891001 +1100
64+--- gtk+2.0-2.23.90.orig/gtk/gtk.h 2011-01-06 12:15:12.000000000 -0500
65++++ gtk+2.0-2.23.90/gtk/gtk.h 2011-01-21 09:23:58.638179868 -0500
66 @@ -65,6 +65,8 @@
67 #include <gtk/gtkcellview.h>
68 #include <gtk/gtkcheckbutton.h>
69@@ -36,10 +36,10 @@
70 #include <gtk/gtkclipboard.h>
71 #include <gtk/gtkcolorbutton.h>
72 #include <gtk/gtkcolorsel.h>
73-Index: gtk+-2.23.90/gtk/gtk.symbols
74+Index: gtk+2.0-2.23.90/gtk/gtk.symbols
75 ===================================================================
76---- gtk+-2.23.90.orig/gtk/gtk.symbols 2011-01-07 12:30:28.913891001 +1100
77-+++ gtk+-2.23.90/gtk/gtk.symbols 2011-01-07 12:30:34.383891001 +1100
78+--- gtk+2.0-2.23.90.orig/gtk/gtk.symbols 2011-01-21 09:23:56.498221932 -0500
79++++ gtk+2.0-2.23.90/gtk/gtk.symbols 2011-01-21 09:23:58.638179868 -0500
80 @@ -2606,6 +2606,21 @@
81 #endif
82 #endif
83@@ -70,10 +70,10 @@
84 #endif
85 #endif
86
87-Index: gtk+-2.23.90/gtk/gtkmenubar.c
88+Index: gtk+2.0-2.23.90/gtk/gtkmenubar.c
89 ===================================================================
90---- gtk+-2.23.90.orig/gtk/gtkmenubar.c 2011-01-07 04:15:13.000000000 +1100
91-+++ gtk+-2.23.90/gtk/gtkmenubar.c 2011-01-07 12:30:34.383891001 +1100
92+--- gtk+2.0-2.23.90.orig/gtk/gtkmenubar.c 2011-01-06 12:15:13.000000000 -0500
93++++ gtk+2.0-2.23.90/gtk/gtkmenubar.c 2011-01-21 09:23:58.638179868 -0500
94 @@ -107,7 +107,7 @@
95 widget_class->size_allocate = gtk_menu_bar_size_allocate;
96 widget_class->expose_event = gtk_menu_bar_expose;
97@@ -150,10 +150,28 @@
98 if (gtk_widget_get_visible (widget))
99 {
100 menu_bar = GTK_MENU_BAR (widget);
101-Index: gtk+-2.23.90/gtk/gtkmenushell.c
102+@@ -626,8 +669,15 @@
103+ GtkMenuShell *menu_shell = GTK_MENU_SHELL (menubars->data);
104+
105+ _gtk_menu_shell_set_keyboard_mode (menu_shell, TRUE);
106+- _gtk_menu_shell_activate (menu_shell);
107+- gtk_menu_shell_select_first (menu_shell, FALSE);
108++ if (ubuntu_gtk_menu_shell_activate_first (GTK_MENU_SHELL (menu_shell), FALSE))
109++ {
110++ //g_print ("send activate to remote!\n");
111++ }
112++ else
113++ {
114++ _gtk_menu_shell_activate (menu_shell);
115++ gtk_menu_shell_select_first (menu_shell, FALSE);
116++ }
117+
118+ g_list_free (menubars);
119+
120+Index: gtk+2.0-2.23.90/gtk/gtkmenushell.c
121 ===================================================================
122---- gtk+-2.23.90.orig/gtk/gtkmenushell.c 2011-01-07 04:15:13.000000000 +1100
123-+++ gtk+-2.23.90/gtk/gtkmenushell.c 2011-01-07 12:30:34.383891001 +1100
124+--- gtk+2.0-2.23.90.orig/gtk/gtkmenushell.c 2011-01-06 12:15:13.000000000 -0500
125++++ gtk+2.0-2.23.90/gtk/gtkmenushell.c 2011-01-21 09:23:58.638179868 -0500
126 @@ -37,6 +37,7 @@
127 #include "gtkmenubar.h"
128 #include "gtkmenuitem.h"
129@@ -314,7 +332,7 @@
130 }
131
132 static void
133-@@ -1815,5 +1883,25 @@
134+@@ -1815,5 +1883,52 @@
135 }
136 }
137
138@@ -338,12 +356,39 @@
139 + return FALSE;
140 +}
141 +
142++gboolean
143++ubuntu_gtk_menu_shell_activate_first (GtkMenuShell *menu_shell,
144++ gboolean search_sensitive)
145++{
146++ GtkWidget *to_select = NULL;
147++ GList *tmp_list;
148++
149++ tmp_list = menu_shell->children;
150++ while (tmp_list)
151++ {
152++ GtkWidget *child = tmp_list->data;
153++
154++ if ((!search_sensitive && gtk_widget_get_visible (child)) ||
155++ _gtk_menu_item_is_selectable (child))
156++ {
157++ to_select = child;
158++ if (!GTK_IS_TEAROFF_MENU_ITEM (child))
159++ break;
160++ }
161++
162++ tmp_list = tmp_list->next;
163++ }
164++
165++ return to_select &&
166++ ubuntu_gtk_menu_shell_activate_mnemonic(menu_shell, to_select);
167++}
168++
169 #define __GTK_MENU_SHELL_C__
170 #include "gtkaliasdef.c"
171-Index: gtk+-2.23.90/gtk/tests/Makefile.am
172+Index: gtk+2.0-2.23.90/gtk/tests/Makefile.am
173 ===================================================================
174---- gtk+-2.23.90.orig/gtk/tests/Makefile.am 2011-01-07 04:15:15.000000000 +1100
175-+++ gtk+-2.23.90/gtk/tests/Makefile.am 2011-01-07 12:30:34.383891001 +1100
176+--- gtk+2.0-2.23.90.orig/gtk/tests/Makefile.am 2011-01-06 12:15:15.000000000 -0500
177++++ gtk+2.0-2.23.90/gtk/tests/Makefile.am 2011-01-21 09:23:58.638179868 -0500
178 @@ -45,6 +45,10 @@
179 recentmanager_SOURCES = recentmanager.c
180 recentmanager_LDADD = $(progs_ldadd)
181@@ -355,10 +400,10 @@
182 TEST_PROGS += floating
183 floating_SOURCES = floating.c
184 floating_LDADD = $(progs_ldadd)
185-Index: gtk+-2.23.90/gtk/tests/menuproxy.c
186+Index: gtk+2.0-2.23.90/gtk/tests/menuproxy.c
187 ===================================================================
188 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
189-+++ gtk+-2.23.90/gtk/tests/menuproxy.c 2011-01-07 12:30:34.383891001 +1100
190++++ gtk+2.0-2.23.90/gtk/tests/menuproxy.c 2011-01-21 09:23:58.648179671 -0500
191 @@ -0,0 +1,278 @@
192 +/*
193 + * Copyright (C) 2009 Canonical, Ltd.
194@@ -638,10 +683,10 @@
195 +
196 + return g_test_run();
197 +}
198-Index: gtk+-2.23.90/gtk/ubuntumenuproxy.c
199+Index: gtk+2.0-2.23.90/gtk/ubuntumenuproxy.c
200 ===================================================================
201 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
202-+++ gtk+-2.23.90/gtk/ubuntumenuproxy.c 2011-01-07 12:30:34.383891001 +1100
203++++ gtk+2.0-2.23.90/gtk/ubuntumenuproxy.c 2011-01-21 09:23:58.648179671 -0500
204 @@ -0,0 +1,249 @@
205 +/*
206 + * Copyright (C) 2010 Canonical, Ltd.
207@@ -892,10 +937,10 @@
208 +
209 +#define __UBUNTU_MENU_PROXY_C__
210 +#include "gtkaliasdef.c"
211-Index: gtk+-2.23.90/gtk/ubuntumenuproxy.h
212+Index: gtk+2.0-2.23.90/gtk/ubuntumenuproxy.h
213 ===================================================================
214 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
215-+++ gtk+-2.23.90/gtk/ubuntumenuproxy.h 2011-01-07 12:30:34.383891001 +1100
216++++ gtk+2.0-2.23.90/gtk/ubuntumenuproxy.h 2011-01-21 09:23:58.648179671 -0500
217 @@ -0,0 +1,74 @@
218 +/*
219 + * Copyright (C) 2010 Canonical, Ltd.
220@@ -971,10 +1016,10 @@
221 +G_END_DECLS
222 +
223 +#endif /* __UBUNTU_MENU_PROXY_H__ */
224-Index: gtk+-2.23.90/gtk/ubuntumenuproxymodule.c
225+Index: gtk+2.0-2.23.90/gtk/ubuntumenuproxymodule.c
226 ===================================================================
227 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
228-+++ gtk+-2.23.90/gtk/ubuntumenuproxymodule.c 2011-01-07 12:30:34.383891001 +1100
229++++ gtk+2.0-2.23.90/gtk/ubuntumenuproxymodule.c 2011-01-21 09:24:12.467904054 -0500
230 @@ -0,0 +1,212 @@
231 +/*
232 + * Copyright (C) 2010 Canonical, Ltd.
233@@ -1188,10 +1233,10 @@
234 +
235 +#define __UBUNTU_MENU_PROXY_MODULE_C__
236 +#include "gtkaliasdef.c"
237-Index: gtk+-2.23.90/gtk/ubuntumenuproxymodule.h
238+Index: gtk+2.0-2.23.90/gtk/ubuntumenuproxymodule.h
239 ===================================================================
240 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
241-+++ gtk+-2.23.90/gtk/ubuntumenuproxymodule.h 2011-01-07 12:30:34.383891001 +1100
242++++ gtk+2.0-2.23.90/gtk/ubuntumenuproxymodule.h 2011-01-21 09:23:58.648179671 -0500
243 @@ -0,0 +1,69 @@
244 +/*
245 + * Copyright (C) 2010 Canonical, Ltd.
246@@ -1262,10 +1307,10 @@
247 +G_END_DECLS
248 +
249 +#endif /* __UBUNTU_MENU_PROXY_MODULE_H__ */
250-Index: gtk+-2.23.90/gtk/gtkwindow.c
251+Index: gtk+2.0-2.23.90/gtk/gtkwindow.c
252 ===================================================================
253---- gtk+-2.23.90.orig/gtk/gtkwindow.c 2011-01-07 04:45:15.000000000 +1100
254-+++ gtk+-2.23.90/gtk/gtkwindow.c 2011-01-07 12:30:34.393891001 +1100
255+--- gtk+2.0-2.23.90.orig/gtk/gtkwindow.c 2011-01-21 09:23:52.318364336 -0500
256++++ gtk+2.0-2.23.90/gtk/gtkwindow.c 2011-01-21 09:23:58.648179671 -0500
257 @@ -94,7 +94,8 @@
258 PROP_GRAVITY,
259 PROP_TRANSIENT_FOR,
260@@ -1320,10 +1365,10 @@
261 default:
262 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
263 break;
264-Index: gtk+-2.23.90/gtk/gtkmenuitem.c
265+Index: gtk+2.0-2.23.90/gtk/gtkmenuitem.c
266 ===================================================================
267---- gtk+-2.23.90.orig/gtk/gtkmenuitem.c 2011-01-07 04:15:13.000000000 +1100
268-+++ gtk+-2.23.90/gtk/gtkmenuitem.c 2011-01-07 12:30:34.393891001 +1100
269+--- gtk+2.0-2.23.90.orig/gtk/gtkmenuitem.c 2011-01-21 09:23:52.278365796 -0500
270++++ gtk+2.0-2.23.90/gtk/gtkmenuitem.c 2011-01-21 09:23:58.648179671 -0500
271 @@ -1395,7 +1395,17 @@
272 widget);
273 }

Subscribers

People subscribed via source and target branches

to all changes: