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

Proposed by Michael Terry
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
debian/changelog (+8/-1)
debian/libgtk2.0-0.symbols (+1/-0)
debian/patches/043_ubuntu_menu_proxy.patch (+80/-35)
To merge this branch: bzr merge lp:~mterry/gtk/ubuntu-f10
Reviewer Review Type Date Requested Status
Ubuntu Desktop 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.
Revision history for this message
Cody Russell (bratsche) wrote :

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

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/changelog'
--- debian/changelog 2011-01-19 10:44:49 +0000
+++ debian/changelog 2011-01-21 14:45:14 +0000
@@ -1,12 +1,19 @@
1gtk+2.0 (2.23.90-0ubuntu5) UNRELEASED; urgency=low1gtk+2.0 (2.23.90-0ubuntu5) UNRELEASED; urgency=low
22
3 [ Sebastien Bacher ]
3 * debian/patches/093_gtk3_gtkimage_fallbacks_use.patch:4 * debian/patches/093_gtk3_gtkimage_fallbacks_use.patch:
4 - backported gtk3 patch to add a "use-fallback" property to GtkImage, using 5 - backported gtk3 patch to add a "use-fallback" property to GtkImage, using
5 it "icon-name and GIcon type of GtkImages can use automatic fallback 6 it "icon-name and GIcon type of GtkImages can use automatic fallback
6 names.", it will be useful for the indicator stack7 names.", it will be useful for the indicator stack
7 (lp: #704632)8 (lp: #704632)
89
9 -- Sebastien Bacher <seb128@ubuntu.com> Wed, 19 Jan 2011 11:38:31 +010010 [ Michael Terry ]
11 * debian/patches/043_ubuntu_menu_proxy.patch:
12 - Update to proxy F10 presses to the global menu. LP: #689178
13 * debian/libgtk2.0-0.symbols:
14 - Add new symbol ubuntu_gtk_menu_shell_activate_first
15
16 -- Michael Terry <mterry@ubuntu.com> Fri, 21 Jan 2011 09:25:45 -0500
1017
11gtk+2.0 (2.23.90-0ubuntu4) natty; urgency=low18gtk+2.0 (2.23.90-0ubuntu4) natty; urgency=low
1219
1320
=== modified file 'debian/libgtk2.0-0.symbols'
--- debian/libgtk2.0-0.symbols 2011-01-12 17:48:54 +0000
+++ debian/libgtk2.0-0.symbols 2011-01-21 14:45:14 +0000
@@ -4726,6 +4726,7 @@
4726 gtk_window_unstick@Base 2.8.04726 gtk_window_unstick@Base 2.8.0
4727 gtk_wrap_mode_get_type@Base 2.8.04727 gtk_wrap_mode_get_type@Base 2.8.0
4728 hildon_gtk_file_chooser_install_properties@Base 2.10.04728 hildon_gtk_file_chooser_install_properties@Base 2.10.0
4729 ubuntu_gtk_menu_shell_activate_first@Base 2.23.90-0ubuntu4
4729 ubuntu_gtk_menu_shell_activate_mnemonic@Base 2.21.6-1ubuntu5.14730 ubuntu_gtk_menu_shell_activate_mnemonic@Base 2.21.6-1ubuntu5.1
4730 ubuntu_gtk_widget_set_has_grab@Base 2.21.6-1ubuntu34731 ubuntu_gtk_widget_set_has_grab@Base 2.21.6-1ubuntu3
4731 ubuntu_menu_proxy_activate_menu@Base 2.21.6-1ubuntu5.14732 ubuntu_menu_proxy_activate_menu@Base 2.21.6-1ubuntu5.1
47324733
=== modified file 'debian/patches/043_ubuntu_menu_proxy.patch'
--- debian/patches/043_ubuntu_menu_proxy.patch 2011-01-07 02:18:53 +0000
+++ debian/patches/043_ubuntu_menu_proxy.patch 2011-01-21 14:45:14 +0000
@@ -1,10 +1,10 @@
1## Description: add some description1## Description: add some description
2## Origin/Author: add some origin or author2## Origin/Author: add some origin or author
3## Bug: bug URL3## Bug: bug URL
4Index: gtk+-2.23.90/gtk/Makefile.am4Index: gtk+2.0-2.23.90/gtk/Makefile.am
5===================================================================5===================================================================
6--- gtk+-2.23.90.orig/gtk/Makefile.am 2011-01-07 12:30:17.493891001 +11006--- gtk+2.0-2.23.90.orig/gtk/Makefile.am 2011-01-21 09:23:55.728241188 -0500
7+++ gtk+-2.23.90/gtk/Makefile.am 2011-01-07 12:30:34.383891001 +11007+++ gtk+2.0-2.23.90/gtk/Makefile.am 2011-01-21 09:23:58.638179868 -0500
8@@ -249,6 +249,8 @@8@@ -249,6 +249,8 @@
9 gtkmenu.h \9 gtkmenu.h \
10 gtkmenubar.h \10 gtkmenubar.h \
@@ -23,10 +23,10 @@
23 gtkmenushell.c \23 gtkmenushell.c \
24 gtkmenutoolbutton.c \24 gtkmenutoolbutton.c \
25 gtkmessagedialog.c \25 gtkmessagedialog.c \
26Index: gtk+-2.23.90/gtk/gtk.h26Index: gtk+2.0-2.23.90/gtk/gtk.h
27===================================================================27===================================================================
28--- gtk+-2.23.90.orig/gtk/gtk.h 2011-01-07 04:15:12.000000000 +110028--- gtk+2.0-2.23.90.orig/gtk/gtk.h 2011-01-06 12:15:12.000000000 -0500
29+++ gtk+-2.23.90/gtk/gtk.h 2011-01-07 12:30:34.383891001 +110029+++ gtk+2.0-2.23.90/gtk/gtk.h 2011-01-21 09:23:58.638179868 -0500
30@@ -65,6 +65,8 @@30@@ -65,6 +65,8 @@
31 #include <gtk/gtkcellview.h>31 #include <gtk/gtkcellview.h>
32 #include <gtk/gtkcheckbutton.h>32 #include <gtk/gtkcheckbutton.h>
@@ -36,10 +36,10 @@
36 #include <gtk/gtkclipboard.h>36 #include <gtk/gtkclipboard.h>
37 #include <gtk/gtkcolorbutton.h>37 #include <gtk/gtkcolorbutton.h>
38 #include <gtk/gtkcolorsel.h>38 #include <gtk/gtkcolorsel.h>
39Index: gtk+-2.23.90/gtk/gtk.symbols39Index: gtk+2.0-2.23.90/gtk/gtk.symbols
40===================================================================40===================================================================
41--- gtk+-2.23.90.orig/gtk/gtk.symbols 2011-01-07 12:30:28.913891001 +110041--- gtk+2.0-2.23.90.orig/gtk/gtk.symbols 2011-01-21 09:23:56.498221932 -0500
42+++ gtk+-2.23.90/gtk/gtk.symbols 2011-01-07 12:30:34.383891001 +110042+++ gtk+2.0-2.23.90/gtk/gtk.symbols 2011-01-21 09:23:58.638179868 -0500
43@@ -2606,6 +2606,21 @@43@@ -2606,6 +2606,21 @@
44 #endif44 #endif
45 #endif45 #endif
@@ -70,10 +70,10 @@
70 #endif70 #endif
71 #endif71 #endif
72 72
73Index: gtk+-2.23.90/gtk/gtkmenubar.c73Index: gtk+2.0-2.23.90/gtk/gtkmenubar.c
74===================================================================74===================================================================
75--- gtk+-2.23.90.orig/gtk/gtkmenubar.c 2011-01-07 04:15:13.000000000 +110075--- gtk+2.0-2.23.90.orig/gtk/gtkmenubar.c 2011-01-06 12:15:13.000000000 -0500
76+++ gtk+-2.23.90/gtk/gtkmenubar.c 2011-01-07 12:30:34.383891001 +110076+++ gtk+2.0-2.23.90/gtk/gtkmenubar.c 2011-01-21 09:23:58.638179868 -0500
77@@ -107,7 +107,7 @@77@@ -107,7 +107,7 @@
78 widget_class->size_allocate = gtk_menu_bar_size_allocate;78 widget_class->size_allocate = gtk_menu_bar_size_allocate;
79 widget_class->expose_event = gtk_menu_bar_expose;79 widget_class->expose_event = gtk_menu_bar_expose;
@@ -150,10 +150,28 @@
150 if (gtk_widget_get_visible (widget))150 if (gtk_widget_get_visible (widget))
151 {151 {
152 menu_bar = GTK_MENU_BAR (widget);152 menu_bar = GTK_MENU_BAR (widget);
153Index: gtk+-2.23.90/gtk/gtkmenushell.c153@@ -626,8 +669,15 @@
154 GtkMenuShell *menu_shell = GTK_MENU_SHELL (menubars->data);
155
156 _gtk_menu_shell_set_keyboard_mode (menu_shell, TRUE);
157- _gtk_menu_shell_activate (menu_shell);
158- gtk_menu_shell_select_first (menu_shell, FALSE);
159+ if (ubuntu_gtk_menu_shell_activate_first (GTK_MENU_SHELL (menu_shell), FALSE))
160+ {
161+ //g_print ("send activate to remote!\n");
162+ }
163+ else
164+ {
165+ _gtk_menu_shell_activate (menu_shell);
166+ gtk_menu_shell_select_first (menu_shell, FALSE);
167+ }
168
169 g_list_free (menubars);
170
171Index: gtk+2.0-2.23.90/gtk/gtkmenushell.c
154===================================================================172===================================================================
155--- gtk+-2.23.90.orig/gtk/gtkmenushell.c 2011-01-07 04:15:13.000000000 +1100173--- gtk+2.0-2.23.90.orig/gtk/gtkmenushell.c 2011-01-06 12:15:13.000000000 -0500
156+++ gtk+-2.23.90/gtk/gtkmenushell.c 2011-01-07 12:30:34.383891001 +1100174+++ gtk+2.0-2.23.90/gtk/gtkmenushell.c 2011-01-21 09:23:58.638179868 -0500
157@@ -37,6 +37,7 @@175@@ -37,6 +37,7 @@
158 #include "gtkmenubar.h"176 #include "gtkmenubar.h"
159 #include "gtkmenuitem.h"177 #include "gtkmenuitem.h"
@@ -314,7 +332,7 @@
314 }332 }
315 333
316 static void334 static void
317@@ -1815,5 +1883,25 @@335@@ -1815,5 +1883,52 @@
318 }336 }
319 }337 }
320 338
@@ -338,12 +356,39 @@
338+ return FALSE;356+ return FALSE;
339+}357+}
340+358+
359+gboolean
360+ubuntu_gtk_menu_shell_activate_first (GtkMenuShell *menu_shell,
361+ gboolean search_sensitive)
362+{
363+ GtkWidget *to_select = NULL;
364+ GList *tmp_list;
365+
366+ tmp_list = menu_shell->children;
367+ while (tmp_list)
368+ {
369+ GtkWidget *child = tmp_list->data;
370+
371+ if ((!search_sensitive && gtk_widget_get_visible (child)) ||
372+ _gtk_menu_item_is_selectable (child))
373+ {
374+ to_select = child;
375+ if (!GTK_IS_TEAROFF_MENU_ITEM (child))
376+ break;
377+ }
378+
379+ tmp_list = tmp_list->next;
380+ }
381+
382+ return to_select &&
383+ ubuntu_gtk_menu_shell_activate_mnemonic(menu_shell, to_select);
384+}
385+
341 #define __GTK_MENU_SHELL_C__386 #define __GTK_MENU_SHELL_C__
342 #include "gtkaliasdef.c"387 #include "gtkaliasdef.c"
343Index: gtk+-2.23.90/gtk/tests/Makefile.am388Index: gtk+2.0-2.23.90/gtk/tests/Makefile.am
344===================================================================389===================================================================
345--- gtk+-2.23.90.orig/gtk/tests/Makefile.am 2011-01-07 04:15:15.000000000 +1100390--- gtk+2.0-2.23.90.orig/gtk/tests/Makefile.am 2011-01-06 12:15:15.000000000 -0500
346+++ gtk+-2.23.90/gtk/tests/Makefile.am 2011-01-07 12:30:34.383891001 +1100391+++ gtk+2.0-2.23.90/gtk/tests/Makefile.am 2011-01-21 09:23:58.638179868 -0500
347@@ -45,6 +45,10 @@392@@ -45,6 +45,10 @@
348 recentmanager_SOURCES = recentmanager.c393 recentmanager_SOURCES = recentmanager.c
349 recentmanager_LDADD = $(progs_ldadd)394 recentmanager_LDADD = $(progs_ldadd)
@@ -355,10 +400,10 @@
355 TEST_PROGS += floating400 TEST_PROGS += floating
356 floating_SOURCES = floating.c401 floating_SOURCES = floating.c
357 floating_LDADD = $(progs_ldadd)402 floating_LDADD = $(progs_ldadd)
358Index: gtk+-2.23.90/gtk/tests/menuproxy.c403Index: gtk+2.0-2.23.90/gtk/tests/menuproxy.c
359===================================================================404===================================================================
360--- /dev/null 1970-01-01 00:00:00.000000000 +0000405--- /dev/null 1970-01-01 00:00:00.000000000 +0000
361+++ gtk+-2.23.90/gtk/tests/menuproxy.c 2011-01-07 12:30:34.383891001 +1100406+++ gtk+2.0-2.23.90/gtk/tests/menuproxy.c 2011-01-21 09:23:58.648179671 -0500
362@@ -0,0 +1,278 @@407@@ -0,0 +1,278 @@
363+/*408+/*
364+ * Copyright (C) 2009 Canonical, Ltd.409+ * Copyright (C) 2009 Canonical, Ltd.
@@ -638,10 +683,10 @@
638+683+
639+ return g_test_run();684+ return g_test_run();
640+}685+}
641Index: gtk+-2.23.90/gtk/ubuntumenuproxy.c686Index: gtk+2.0-2.23.90/gtk/ubuntumenuproxy.c
642===================================================================687===================================================================
643--- /dev/null 1970-01-01 00:00:00.000000000 +0000688--- /dev/null 1970-01-01 00:00:00.000000000 +0000
644+++ gtk+-2.23.90/gtk/ubuntumenuproxy.c 2011-01-07 12:30:34.383891001 +1100689+++ gtk+2.0-2.23.90/gtk/ubuntumenuproxy.c 2011-01-21 09:23:58.648179671 -0500
645@@ -0,0 +1,249 @@690@@ -0,0 +1,249 @@
646+/*691+/*
647+ * Copyright (C) 2010 Canonical, Ltd.692+ * Copyright (C) 2010 Canonical, Ltd.
@@ -892,10 +937,10 @@
892+937+
893+#define __UBUNTU_MENU_PROXY_C__938+#define __UBUNTU_MENU_PROXY_C__
894+#include "gtkaliasdef.c"939+#include "gtkaliasdef.c"
895Index: gtk+-2.23.90/gtk/ubuntumenuproxy.h940Index: gtk+2.0-2.23.90/gtk/ubuntumenuproxy.h
896===================================================================941===================================================================
897--- /dev/null 1970-01-01 00:00:00.000000000 +0000942--- /dev/null 1970-01-01 00:00:00.000000000 +0000
898+++ gtk+-2.23.90/gtk/ubuntumenuproxy.h 2011-01-07 12:30:34.383891001 +1100943+++ gtk+2.0-2.23.90/gtk/ubuntumenuproxy.h 2011-01-21 09:23:58.648179671 -0500
899@@ -0,0 +1,74 @@944@@ -0,0 +1,74 @@
900+/*945+/*
901+ * Copyright (C) 2010 Canonical, Ltd.946+ * Copyright (C) 2010 Canonical, Ltd.
@@ -971,10 +1016,10 @@
971+G_END_DECLS1016+G_END_DECLS
972+1017+
973+#endif /* __UBUNTU_MENU_PROXY_H__ */1018+#endif /* __UBUNTU_MENU_PROXY_H__ */
974Index: gtk+-2.23.90/gtk/ubuntumenuproxymodule.c1019Index: gtk+2.0-2.23.90/gtk/ubuntumenuproxymodule.c
975===================================================================1020===================================================================
976--- /dev/null 1970-01-01 00:00:00.000000000 +00001021--- /dev/null 1970-01-01 00:00:00.000000000 +0000
977+++ gtk+-2.23.90/gtk/ubuntumenuproxymodule.c 2011-01-07 12:30:34.383891001 +11001022+++ gtk+2.0-2.23.90/gtk/ubuntumenuproxymodule.c 2011-01-21 09:24:12.467904054 -0500
978@@ -0,0 +1,212 @@1023@@ -0,0 +1,212 @@
979+/*1024+/*
980+ * Copyright (C) 2010 Canonical, Ltd.1025+ * Copyright (C) 2010 Canonical, Ltd.
@@ -1188,10 +1233,10 @@
1188+1233+
1189+#define __UBUNTU_MENU_PROXY_MODULE_C__1234+#define __UBUNTU_MENU_PROXY_MODULE_C__
1190+#include "gtkaliasdef.c"1235+#include "gtkaliasdef.c"
1191Index: gtk+-2.23.90/gtk/ubuntumenuproxymodule.h1236Index: gtk+2.0-2.23.90/gtk/ubuntumenuproxymodule.h
1192===================================================================1237===================================================================
1193--- /dev/null 1970-01-01 00:00:00.000000000 +00001238--- /dev/null 1970-01-01 00:00:00.000000000 +0000
1194+++ gtk+-2.23.90/gtk/ubuntumenuproxymodule.h 2011-01-07 12:30:34.383891001 +11001239+++ gtk+2.0-2.23.90/gtk/ubuntumenuproxymodule.h 2011-01-21 09:23:58.648179671 -0500
1195@@ -0,0 +1,69 @@1240@@ -0,0 +1,69 @@
1196+/*1241+/*
1197+ * Copyright (C) 2010 Canonical, Ltd.1242+ * Copyright (C) 2010 Canonical, Ltd.
@@ -1262,10 +1307,10 @@
1262+G_END_DECLS1307+G_END_DECLS
1263+1308+
1264+#endif /* __UBUNTU_MENU_PROXY_MODULE_H__ */1309+#endif /* __UBUNTU_MENU_PROXY_MODULE_H__ */
1265Index: gtk+-2.23.90/gtk/gtkwindow.c1310Index: gtk+2.0-2.23.90/gtk/gtkwindow.c
1266===================================================================1311===================================================================
1267--- gtk+-2.23.90.orig/gtk/gtkwindow.c 2011-01-07 04:45:15.000000000 +11001312--- gtk+2.0-2.23.90.orig/gtk/gtkwindow.c 2011-01-21 09:23:52.318364336 -0500
1268+++ gtk+-2.23.90/gtk/gtkwindow.c 2011-01-07 12:30:34.393891001 +11001313+++ gtk+2.0-2.23.90/gtk/gtkwindow.c 2011-01-21 09:23:58.648179671 -0500
1269@@ -94,7 +94,8 @@1314@@ -94,7 +94,8 @@
1270 PROP_GRAVITY,1315 PROP_GRAVITY,
1271 PROP_TRANSIENT_FOR,1316 PROP_TRANSIENT_FOR,
@@ -1320,10 +1365,10 @@
1320 default:1365 default:
1321 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);1366 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
1322 break;1367 break;
1323Index: gtk+-2.23.90/gtk/gtkmenuitem.c1368Index: gtk+2.0-2.23.90/gtk/gtkmenuitem.c
1324===================================================================1369===================================================================
1325--- gtk+-2.23.90.orig/gtk/gtkmenuitem.c 2011-01-07 04:15:13.000000000 +11001370--- gtk+2.0-2.23.90.orig/gtk/gtkmenuitem.c 2011-01-21 09:23:52.278365796 -0500
1326+++ gtk+-2.23.90/gtk/gtkmenuitem.c 2011-01-07 12:30:34.393891001 +11001371+++ gtk+2.0-2.23.90/gtk/gtkmenuitem.c 2011-01-21 09:23:58.648179671 -0500
1327@@ -1395,7 +1395,17 @@1372@@ -1395,7 +1395,17 @@
1328 widget);1373 widget);
1329 }1374 }

Subscribers

People subscribed via source and target branches

to all changes: