Merge lp:~attente/gtk/gtk2-no-menu-proxy into lp:~ubuntu-desktop/gtk/ubuntu

Proposed by William Hua
Status: Merged
Merge reported by: Sebastien Bacher
Merged at revision: not available
Proposed branch: lp:~attente/gtk/gtk2-no-menu-proxy
Merge into: lp:~ubuntu-desktop/gtk/ubuntu
Diff against target: 1602 lines (+0/-1566)
4 files modified
debian/patches/012_ubuntu-set-grab-add.patch (+0/-47)
debian/patches/043_ubuntu_menu_proxy.patch (+0/-1406)
debian/patches/072_indicator_menu_update.patch (+0/-110)
debian/patches/series (+0/-3)
To merge this branch: bzr merge lp:~attente/gtk/gtk2-no-menu-proxy
Reviewer Review Type Date Requested Status
Ubuntu Desktop Pending
Review via email: mp+151619@code.launchpad.net

Description of the change

Remove the menu proxy patch, set grab add patch, and indicator menu update patch.

We shouldn't need these any more since the menu proxy is replaced by unity-gtk-module, set grab add hasn't been used in a while, and support for gtk 2 indicators is gone.

To post a comment you must log in.
Revision history for this message
Sebastien Bacher (seb128) wrote :

Thanks William, we finally got that merged in the packaging trunk, it's going to go to the ubuntu-desktop ppa for some testing before archive upload still though

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== removed file 'debian/patches/012_ubuntu-set-grab-add.patch'
2--- debian/patches/012_ubuntu-set-grab-add.patch 2012-09-04 06:18:43 +0000
3+++ debian/patches/012_ubuntu-set-grab-add.patch 1970-01-01 00:00:00 +0000
4@@ -1,47 +0,0 @@
5-=== modified file 'gtk/gtk.symbols'
6-Index: gtk+-2.24.12/gtk/gtk.symbols
7-===================================================================
8---- gtk+-2.24.12.orig/gtk/gtk.symbols 2011-10-18 11:35:29.000000000 +1300
9-+++ gtk+-2.24.12/gtk/gtk.symbols 2012-09-04 16:42:40.382564335 +1200
10-@@ -5323,6 +5323,7 @@
11- gtk_widget_get_realized
12- gtk_widget_set_mapped
13- gtk_widget_get_mapped
14-+ubuntu_gtk_widget_set_has_grab
15- #endif
16- #endif
17-
18-Index: gtk+-2.24.12/gtk/gtkwidget.c
19-===================================================================
20---- gtk+-2.24.12.orig/gtk/gtkwidget.c 2012-09-04 06:28:02.000000000 +1200
21-+++ gtk+-2.24.12/gtk/gtkwidget.c 2012-09-04 16:42:40.382564335 +1200
22-@@ -11449,5 +11449,15 @@
23- return res;
24- }
25-
26-+void
27-+ubuntu_gtk_widget_set_has_grab (GtkWidget *widget,
28-+ gboolean has_grab)
29-+{
30-+ if (has_grab)
31-+ GTK_OBJECT_FLAGS (widget) |= GTK_HAS_GRAB;
32-+ else
33-+ GTK_OBJECT_FLAGS (widget) &= ~(GTK_HAS_GRAB);
34-+}
35-+
36- #define __GTK_WIDGET_C__
37- #include "gtkaliasdef.c"
38-Index: gtk+-2.24.12/gtk/gtkwidget.h
39-===================================================================
40---- gtk+-2.24.12.orig/gtk/gtkwidget.h 2011-08-16 14:30:52.000000000 +1200
41-+++ gtk+-2.24.12/gtk/gtkwidget.h 2012-09-04 16:42:40.382564335 +1200
42-@@ -1346,6 +1346,9 @@
43- GtkWidget *toplevel,
44- gpointer user_data);
45-
46-+void ubuntu_gtk_widget_set_has_grab (GtkWidget *widget,
47-+ gboolean has_grab);
48-+
49- G_END_DECLS
50-
51- #endif /* __GTK_WIDGET_H__ */
52
53=== removed file 'debian/patches/043_ubuntu_menu_proxy.patch'
54--- debian/patches/043_ubuntu_menu_proxy.patch 2013-02-25 03:55:42 +0000
55+++ debian/patches/043_ubuntu_menu_proxy.patch 1970-01-01 00:00:00 +0000
56@@ -1,1406 +0,0 @@
57-## Description: add some description
58-## Origin/Author: add some origin or author
59-## Bug: bug URL
60-Description: Add GtkMenuProxy support for remoting menus.
61-
62-Index: gtk+2.0-2.24.8/gtk/Makefile.am
63-===================================================================
64---- gtk+2.0-2.24.8.orig/gtk/Makefile.am 2012-01-12 10:59:30.064850584 +0100
65-+++ gtk+2.0-2.24.8/gtk/Makefile.am 2012-01-12 10:59:31.952859946 +0100
66-@@ -246,6 +246,8 @@
67- gtkmenu.h \
68- gtkmenubar.h \
69- gtkmenuitem.h \
70-+ ubuntumenuproxy.h \
71-+ ubuntumenuproxymodule.h \
72- gtkmenushell.h \
73- gtkmenutoolbutton.h \
74- gtkmessagedialog.h \
75-@@ -516,6 +518,8 @@
76- gtkmenu.c \
77- gtkmenubar.c \
78- gtkmenuitem.c \
79-+ ubuntumenuproxy.c \
80-+ ubuntumenuproxymodule.c \
81- gtkmenushell.c \
82- gtkmenutoolbutton.c \
83- gtkmessagedialog.c \
84-Index: gtk+2.0-2.24.8/gtk/gtk.h
85-===================================================================
86---- gtk+2.0-2.24.8.orig/gtk/gtk.h 2012-01-12 10:59:29.888849711 +0100
87-+++ gtk+2.0-2.24.8/gtk/gtk.h 2012-01-12 10:59:31.956859969 +0100
88-@@ -65,6 +65,8 @@
89- #include <gtk/gtkcellview.h>
90- #include <gtk/gtkcheckbutton.h>
91- #include <gtk/gtkcheckmenuitem.h>
92-+#include <gtk/ubuntumenuproxy.h>
93-+#include <gtk/ubuntumenuproxymodule.h>
94- #include <gtk/gtkclipboard.h>
95- #include <gtk/gtkcolorbutton.h>
96- #include <gtk/gtkcolorsel.h>
97-Index: gtk+2.0-2.24.8/gtk/gtk.symbols
98-===================================================================
99---- gtk+2.0-2.24.8.orig/gtk/gtk.symbols 2012-01-12 10:59:31.808859232 +0100
100-+++ gtk+2.0-2.24.8/gtk/gtk.symbols 2012-01-12 10:59:31.956859969 +0100
101-@@ -2600,6 +2600,21 @@
102- #endif
103- #endif
104-
105-+#if IN_HEADER(__UBUNTU_MENU_PROXY_H__)
106-+#if IN_FILE(__UBUNTU_MENU_PROXY_C__)
107-+ubuntu_menu_proxy_get_type G_GNUC_CONST
108-+ubuntu_menu_proxy_get
109-+ubuntu_menu_proxy_insert
110-+#endif
111-+#endif
112-+
113-+#if IN_HEADER(__UBUNTU_MENU_PROXY_MODULE_H__)
114-+#if IN_FILE(__UBUNTU_MENU_PROXY_MODULE_C__)
115-+ubuntu_menu_proxy_module_get_type
116-+ubuntu_menu_proxy_module_get
117-+#endif
118-+#endif
119-+
120- #if IN_HEADER(__GTK_MENU_SHELL_H__)
121- #if IN_FILE(__GTK_MENU_SHELL_C__)
122- gtk_menu_shell_activate_item
123-@@ -2614,6 +2629,7 @@
124- gtk_menu_shell_select_item
125- gtk_menu_shell_set_take_focus
126- gtk_menu_shell_get_take_focus
127-+ubuntu_gtk_menu_shell_activate_mnemonic
128- #endif
129- #endif
130-
131-Index: gtk+2.0-2.24.8/gtk/gtkmenubar.c
132-===================================================================
133---- gtk+2.0-2.24.8.orig/gtk/gtkmenubar.c 2012-01-12 10:59:29.968850108 +0100
134-+++ gtk+2.0-2.24.8/gtk/gtkmenubar.c 2012-01-12 11:03:59.838188316 +0100
135-@@ -107,7 +107,7 @@
136- widget_class->size_allocate = gtk_menu_bar_size_allocate;
137- widget_class->expose_event = gtk_menu_bar_expose;
138- widget_class->hierarchy_changed = gtk_menu_bar_hierarchy_changed;
139--
140-+
141- menu_shell_class->submenu_placement = GTK_TOP_BOTTOM;
142- menu_shell_class->get_popup_delay = gtk_menu_bar_get_popup_delay;
143- menu_shell_class->move_current = gtk_menu_bar_move_current;
144-@@ -218,8 +218,26 @@
145- }
146-
147- static void
148-+local_notify (GtkWidget *widget,
149-+ GParamSpec *pspec,
150-+ gpointer user_data)
151-+{
152-+ gboolean local;
153-+
154-+ g_object_get (widget,
155-+ "ubuntu-local", &local,
156-+ NULL);
157-+
158-+ gtk_widget_queue_resize (widget);
159-+}
160-+
161-+static void
162- gtk_menu_bar_init (GtkMenuBar *object)
163- {
164-+ g_signal_connect (object,
165-+ "notify::ubuntu-local",
166-+ G_CALLBACK (local_notify),
167-+ NULL);
168- }
169-
170- GtkWidget*
171-@@ -284,13 +302,22 @@
172- gint nchildren;
173- GtkRequisition child_requisition;
174- gint ipadding;
175-+ gboolean local = FALSE;
176-
177- g_return_if_fail (GTK_IS_MENU_BAR (widget));
178- g_return_if_fail (requisition != NULL);
179-
180- requisition->width = 0;
181- requisition->height = 0;
182--
183-+
184-+ g_object_get (widget,
185-+ "ubuntu-local",
186-+ &local,
187-+ NULL);
188-+
189-+ if (!local)
190-+ return;
191-+
192- if (gtk_widget_get_visible (widget))
193- {
194- menu_bar = GTK_MENU_BAR (widget);
195-@@ -367,6 +394,7 @@
196- GtkTextDirection direction;
197- gint ltr_x, ltr_y;
198- gint ipadding;
199-+ gboolean local = FALSE;
200-
201- g_return_if_fail (GTK_IS_MENU_BAR (widget));
202- g_return_if_fail (allocation != NULL);
203-@@ -377,6 +405,32 @@
204-
205- direction = gtk_widget_get_direction (widget);
206-
207-+ g_object_get (widget,
208-+ "ubuntu-local",
209-+ &local,
210-+ NULL);
211-+
212-+ if (!local)
213-+ {
214-+ GtkAllocation zero = { 0, 0, 0, 0 };
215-+ GdkWindow *window;
216-+
217-+ /* We manually assign an empty allocation to the menubar to
218-+ * prevent the container from attempting to draw it at all.
219-+ */
220-+ gtk_widget_set_allocation (widget, &zero);
221-+
222-+ /* Then we move the GdkWindow belonging to the menubar outside of
223-+ * the clipping rectangle of the parent window so that we can't
224-+ * see it.
225-+ */
226-+ window = gtk_widget_get_window (widget);
227-+ if (window != NULL)
228-+ gdk_window_move_resize (window, -1, -1, 1, 1);
229-+
230-+ return;
231-+ }
232-+
233- widget->allocation = *allocation;
234- if (gtk_widget_get_realized (widget))
235- gdk_window_move_resize (widget->window,
236-@@ -626,8 +680,15 @@
237- GtkMenuShell *menu_shell = GTK_MENU_SHELL (menubars->data);
238-
239- _gtk_menu_shell_set_keyboard_mode (menu_shell, TRUE);
240-- _gtk_menu_shell_activate (menu_shell);
241-- gtk_menu_shell_select_first (menu_shell, FALSE);
242-+ if (ubuntu_gtk_menu_shell_activate_first (GTK_MENU_SHELL (menu_shell), FALSE))
243-+ {
244-+ //g_print ("send activate to remote!\n");
245-+ }
246-+ else
247-+ {
248-+ _gtk_menu_shell_activate (menu_shell);
249-+ gtk_menu_shell_select_first (menu_shell, FALSE);
250-+ }
251-
252- g_list_free (menubars);
253-
254-Index: gtk+2.0-2.24.8/gtk/gtkmenushell.c
255-===================================================================
256---- gtk+2.0-2.24.8.orig/gtk/gtkmenushell.c 2012-01-12 10:59:29.932849927 +0100
257-+++ gtk+2.0-2.24.8/gtk/gtkmenushell.c 2012-01-12 10:59:31.960859983 +0100
258-@@ -37,6 +37,7 @@
259- #include "gtkmenubar.h"
260- #include "gtkmenuitem.h"
261- #include "gtkmenushell.h"
262-+#include "ubuntumenuproxy.h"
263- #include "gtkmnemonichash.h"
264- #include "gtktearoffmenuitem.h"
265- #include "gtkwindow.h"
266-@@ -64,7 +65,8 @@
267-
268- enum {
269- PROP_0,
270-- PROP_TAKE_FOCUS
271-+ PROP_TAKE_FOCUS,
272-+ PROP_LOCAL
273- };
274-
275- /* Terminology:
276-@@ -135,6 +137,9 @@
277- GtkMnemonicHash *mnemonic_hash;
278- GtkKeyHash *key_hash;
279-
280-+ UbuntuMenuProxy *proxy;
281-+ gboolean local;
282-+
283- guint take_focus : 1;
284- guint activated_submenu : 1;
285- /* This flag is a crutch to keep mnemonics in the same menu
286-@@ -381,6 +386,14 @@
287- TRUE,
288- GTK_PARAM_READWRITE));
289-
290-+ g_object_class_install_property (object_class,
291-+ PROP_LOCAL,
292-+ g_param_spec_boolean ("ubuntu-local",
293-+ P_("Local menu"),
294-+ P_("Determines whether the menu is local"),
295-+ FALSE,
296-+ GTK_PARAM_READWRITE));
297-+
298- g_type_class_add_private (object_class, sizeof (GtkMenuShellPrivate));
299- }
300-
301-@@ -391,6 +404,14 @@
302- }
303-
304- static void
305-+show_local_notify (UbuntuMenuProxy *proxy,
306-+ GParamSpec *pspec,
307-+ GtkMenuShell *shell)
308-+{
309-+ g_object_notify (shell, "ubuntu-local");
310-+}
311-+
312-+static void
313- gtk_menu_shell_init (GtkMenuShell *menu_shell)
314- {
315- GtkMenuShellPrivate *priv = GTK_MENU_SHELL_GET_PRIVATE (menu_shell);
316-@@ -408,6 +429,13 @@
317- priv->key_hash = NULL;
318- priv->take_focus = TRUE;
319- priv->activated_submenu = FALSE;
320-+ priv->proxy = ubuntu_menu_proxy_get ();
321-+ priv->local = FALSE;
322-+
323-+ if (priv->proxy != NULL)
324-+ g_signal_connect (priv->proxy, "notify::show-local",
325-+ G_CALLBACK (show_local_notify),
326-+ menu_shell);
327- }
328-
329- static void
330-@@ -417,12 +445,16 @@
331- GParamSpec *pspec)
332- {
333- GtkMenuShell *menu_shell = GTK_MENU_SHELL (object);
334-+ GtkMenuShellPrivate *priv = GTK_MENU_SHELL_GET_PRIVATE (object);
335-
336- switch (prop_id)
337- {
338- case PROP_TAKE_FOCUS:
339- gtk_menu_shell_set_take_focus (menu_shell, g_value_get_boolean (value));
340- break;
341-+ case PROP_LOCAL:
342-+ priv->local = g_value_get_boolean (value);
343-+ break;
344- default:
345- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
346- break;
347-@@ -436,12 +468,23 @@
348- GParamSpec *pspec)
349- {
350- GtkMenuShell *menu_shell = GTK_MENU_SHELL (object);
351-+ GtkMenuShellPrivate *priv = GTK_MENU_SHELL_GET_PRIVATE (menu_shell);
352-+ gboolean local;
353-
354- switch (prop_id)
355- {
356- case PROP_TAKE_FOCUS:
357- g_value_set_boolean (value, gtk_menu_shell_get_take_focus (menu_shell));
358- break;
359-+ case PROP_LOCAL:
360-+ if (priv->proxy == NULL || ubuntu_menu_proxy_show_local (priv->proxy)) {
361-+ local = TRUE;
362-+ } else {
363-+ local = priv->local;
364-+ }
365-+
366-+ g_value_set_boolean (value, local);
367-+ break;
368- default:
369- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
370- break;
371-@@ -454,6 +497,13 @@
372- GtkMenuShell *menu_shell = GTK_MENU_SHELL (object);
373- GtkMenuShellPrivate *priv = GTK_MENU_SHELL_GET_PRIVATE (menu_shell);
374-
375-+ if (priv->proxy != NULL)
376-+ {
377-+ g_signal_handlers_disconnect_by_func (priv->proxy,
378-+ show_local_notify,
379-+ menu_shell);
380-+ }
381-+
382- if (priv->mnemonic_hash)
383- _gtk_mnemonic_hash_free (priv->mnemonic_hash);
384- if (priv->key_hash)
385-@@ -483,10 +533,21 @@
386- GtkWidget *child,
387- gint position)
388- {
389-+ GtkMenuShellPrivate *priv;
390-+
391- g_return_if_fail (GTK_IS_MENU_SHELL (menu_shell));
392- g_return_if_fail (GTK_IS_MENU_ITEM (child));
393-
394-+ priv = GTK_MENU_SHELL_GET_PRIVATE (menu_shell);
395-+
396- g_signal_emit (menu_shell, menu_shell_signals[INSERT], 0, child, position);
397-+
398-+ /* insert to proxy */
399-+ if (priv->proxy != NULL)
400-+ ubuntu_menu_proxy_insert (priv->proxy,
401-+ GTK_WIDGET (menu_shell),
402-+ child,
403-+ position);
404- }
405-
406- static void
407-@@ -1815,5 +1875,52 @@
408- }
409- }
410-
411-+gboolean
412-+ubuntu_gtk_menu_shell_activate_mnemonic (GtkMenuShell *shell, GtkWidget *item)
413-+{
414-+ GtkMenuShellPrivate *priv;
415-+
416-+ g_return_val_if_fail (GTK_IS_MENU_SHELL (shell), FALSE);
417-+
418-+ priv = GTK_MENU_SHELL_GET_PRIVATE (shell);
419-+
420-+ if (priv->proxy && !ubuntu_menu_proxy_show_local (priv->proxy))
421-+ {
422-+ ubuntu_menu_proxy_activate_menu (priv->proxy,
423-+ item);
424-+
425-+ return TRUE;
426-+ }
427-+
428-+ return FALSE;
429-+}
430-+
431-+gboolean
432-+ubuntu_gtk_menu_shell_activate_first (GtkMenuShell *menu_shell,
433-+ gboolean search_sensitive)
434-+{
435-+ GtkWidget *to_select = NULL;
436-+ GList *tmp_list;
437-+
438-+ tmp_list = menu_shell->children;
439-+ while (tmp_list)
440-+ {
441-+ GtkWidget *child = tmp_list->data;
442-+
443-+ if ((!search_sensitive && gtk_widget_get_visible (child)) ||
444-+ _gtk_menu_item_is_selectable (child))
445-+ {
446-+ to_select = child;
447-+ if (!GTK_IS_TEAROFF_MENU_ITEM (child))
448-+ break;
449-+ }
450-+
451-+ tmp_list = tmp_list->next;
452-+ }
453-+
454-+ return to_select &&
455-+ ubuntu_gtk_menu_shell_activate_mnemonic(menu_shell, to_select);
456-+}
457-+
458- #define __GTK_MENU_SHELL_C__
459- #include "gtkaliasdef.c"
460-Index: gtk+2.0-2.24.8/gtk/tests/Makefile.am
461-===================================================================
462---- gtk+2.0-2.24.8.orig/gtk/tests/Makefile.am 2012-01-12 10:59:30.004850284 +0100
463-+++ gtk+2.0-2.24.8/gtk/tests/Makefile.am 2012-01-12 10:59:31.960859983 +0100
464-@@ -45,6 +45,10 @@
465- recentmanager_SOURCES = recentmanager.c
466- recentmanager_LDADD = $(progs_ldadd)
467-
468-+TEST_PROGS += menuproxy
469-+menuproxy_SOURCES = menuproxy.c
470-+menuproxy_LDADD = $(progs_ldadd)
471-+
472- TEST_PROGS += floating
473- floating_SOURCES = floating.c
474- floating_LDADD = $(progs_ldadd)
475-Index: gtk+2.0-2.24.8/gtk/tests/menuproxy.c
476-===================================================================
477---- /dev/null 1970-01-01 00:00:00.000000000 +0000
478-+++ gtk+2.0-2.24.8/gtk/tests/menuproxy.c 2012-01-12 10:59:31.960859983 +0100
479-@@ -0,0 +1,278 @@
480-+/*
481-+ * Copyright (C) 2009 Canonical, Ltd.
482-+ *
483-+ * This library is free software; you can redistribute it and/or
484-+ * modify it under the terms of the GNU Lesser General Public
485-+ * License as published by the Free Software Foundation; either
486-+ * version 2 of the License, or (at your option) any later version.
487-+ *
488-+ * This library is distributed in the hope that it will be useful,
489-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
490-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
491-+ * Lesser General Public License for more details.
492-+ *
493-+ * You should have received a copy of the GNU Lesser General Public
494-+ * License along with this library; if not, write to the
495-+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
496-+ * Boston, MA 02111-1307, USA.
497-+ *
498-+ * Authors: Cody Russell <bratsche@gnome.org>
499-+ */
500-+
501-+#undef GTK_DISABLE_DEPRECATED
502-+#include "../gtk/gtk.h"
503-+
504-+typedef struct _TestProxy TestProxy;
505-+typedef struct _TestProxyClass TestProxyClass;
506-+
507-+//static GType test_proxy_type_id = 0;
508-+//static TestProxyClass *test_proxy_parent_class = NULL;
509-+
510-+#define TEST_TYPE_PROXY (test_proxy_type_id)
511-+#define TEST_PROXY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TEST_TYPE_PROXY, TestProxy))
512-+#define TEST_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), TEST_TYPE_PROXY, TestProxyClass))
513-+#define TEST_IS_PROXY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TEST_TYPE_PROXY))
514-+
515-+struct _TestProxy
516-+{
517-+ UbuntuMenuProxy parent_object;
518-+};
519-+
520-+struct _TestProxyClass
521-+{
522-+ UbuntuMenuProxyClass parent_class;
523-+};
524-+
525-+static void test_proxy_insert (UbuntuMenuProxy *proxy,
526-+ GtkWidget *child,
527-+ guint position);
528-+
529-+G_DEFINE_DYNAMIC_TYPE(TestProxy, test_proxy, UBUNTU_TYPE_MENU_PROXY)
530-+
531-+static void
532-+test_proxy_init (TestProxy *proxy)
533-+{
534-+}
535-+
536-+static void
537-+test_proxy_class_init (TestProxyClass *class)
538-+{
539-+ UbuntuMenuProxyClass *proxy_class = UBUNTU_MENU_PROXY_CLASS (class);
540-+
541-+ test_proxy_parent_class = g_type_class_peek_parent (class);
542-+
543-+ proxy_class->insert = test_proxy_insert;
544-+}
545-+
546-+static void
547-+test_proxy_class_finalize (TestProxyClass *class)
548-+{
549-+}
550-+
551-+static void
552-+test_proxy_insert (UbuntuMenuProxy *proxy,
553-+ GtkWidget *child,
554-+ guint position)
555-+{
556-+}
557-+
558-+/* ---------------------------------------------------- */
559-+
560-+#define TEST_TYPE_MODULE (test_module_get_type ())
561-+#define TEST_MODULE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TEST_TYPE_MODULE, TestModule))
562-+#define TEST_MODULE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), TEST_TYPE_MODULE, TestModuleClass))
563-+#define TEST_IS_MODULE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TEST_TYPE_MODULE))
564-+#define TEST_IS_MODULE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), TEST_TYPE_MODULE))
565-+#define TEST_MODULE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TEST_TYPE_MODULE, TestModuleClass))
566-+
567-+
568-+typedef struct _TestModule TestModule;
569-+typedef struct _TestModuleClass TestModuleClass;
570-+
571-+struct _TestModule
572-+{
573-+ GTypeModule parent_instance;
574-+};
575-+
576-+struct _TestModuleClass
577-+{
578-+ GTypeModuleClass parent_class;
579-+};
580-+
581-+static gboolean
582-+test_module_load (GTypeModule *module)
583-+{
584-+ g_print ("registering type...\n");
585-+ g_print (" type_id = %d\n", test_proxy_type_id);
586-+
587-+ test_proxy_register_type (G_TYPE_MODULE (module));
588-+
589-+ //test_proxy_get_type (G_TYPE_MODULE (module));
590-+
591-+ g_print (" type_id = %d\n", test_proxy_type_id);
592-+
593-+ return TRUE;
594-+}
595-+
596-+static void
597-+test_module_unload (GTypeModule *module)
598-+{
599-+}
600-+
601-+static void
602-+test_module_class_init (TestModuleClass *class)
603-+{
604-+ GTypeModuleClass *type_module_class = G_TYPE_MODULE_CLASS (class);
605-+
606-+ type_module_class->load = test_module_load;
607-+ type_module_class->unload = test_module_unload;
608-+}
609-+
610-+static void
611-+test_module_init (TestModule *module)
612-+{
613-+}
614-+
615-+G_DEFINE_TYPE (TestModule, test_module, G_TYPE_TYPE_MODULE);
616-+
617-+TestModule *
618-+test_module_new (void)
619-+{
620-+ TestModule *module = g_object_new (TEST_TYPE_MODULE,
621-+ NULL);
622-+
623-+ g_print ("test_module_new(): %p\n", module);
624-+
625-+ return module;
626-+}
627-+
628-+
629-+/* ---------------------------------------------------- */
630-+
631-+static void
632-+non_null_proxy_test (void)
633-+{
634-+ UbuntuMenuProxyModule *module;
635-+
636-+ /* prevent the module loader from finding a proxy module */
637-+ g_unsetenv ("UBUNTU_MENUPROXY");
638-+
639-+ module = ubuntu_menu_proxy_module_get ();
640-+ test_proxy_register_type (G_TYPE_MODULE (module));
641-+ //test_proxy_get_type (G_TYPE_MODULE (module));
642-+
643-+ GtkWidget *widget = g_object_new (GTK_TYPE_MENU_BAR, NULL);
644-+ g_object_ref_sink (widget);
645-+
646-+ g_assert (GTK_IS_MENU_BAR (widget));
647-+ //g_assert (GTK_MENU_SHELL (widget)->proxy != NULL);
648-+
649-+ g_object_unref (widget);
650-+}
651-+
652-+static void
653-+null_proxy_test (void)
654-+{
655-+ GtkWidget *widget = g_object_new (GTK_TYPE_MENU_BAR, NULL);
656-+ g_object_ref_sink (widget);
657-+
658-+ g_assert (GTK_IS_MENU_BAR (widget));
659-+
660-+ //g_assert (GTK_MENU_SHELL (widget)->proxy == NULL);
661-+
662-+ g_object_unref (widget);
663-+}
664-+
665-+static gboolean inserted_called = FALSE;
666-+
667-+static void
668-+inserted_cb (UbuntuMenuProxy *proxy,
669-+ GtkWidget *child,
670-+ guint position,
671-+ gpointer data)
672-+{
673-+ g_return_if_fail (UBUNTU_IS_MENU_PROXY (proxy));
674-+ g_return_if_fail (GTK_IS_WIDGET (child));
675-+ inserted_called = TRUE;
676-+}
677-+
678-+static void
679-+menubar_signals_proxy_test (void)
680-+{
681-+ GtkWidget *widget = NULL;
682-+ GtkWidget *menuitem = NULL;
683-+ UbuntuMenuProxy *proxy;
684-+
685-+ //ubuntu_menu_proxy_register_type (test_proxy_get_type ());
686-+
687-+ widget = g_object_new (GTK_TYPE_MENU_BAR, NULL);
688-+ g_object_ref_sink (widget);
689-+
690-+ g_assert (GTK_IS_MENU_BAR (widget));
691-+ //g_assert (GTK_MENU_SHELL (widget)->proxy != NULL);
692-+
693-+ /*
694-+ proxy = GTK_MENU_SHELL (widget)->proxy;
695-+
696-+ g_signal_connect (proxy,
697-+ "inserted", G_CALLBACK (inserted_cb),
698-+ NULL);
699-+ */
700-+
701-+ // insert menuitem
702-+ menuitem = gtk_menu_item_new_with_label ("Test Item");
703-+ gtk_menu_shell_append (GTK_MENU_SHELL (widget),
704-+ menuitem);
705-+
706-+ g_assert (inserted_called == TRUE);
707-+
708-+ g_object_unref (widget);
709-+}
710-+
711-+static void
712-+proxy_type_exists_test (void)
713-+{
714-+#if 0
715-+ UbuntuMenuProxyModule *module;
716-+
717-+ g_unsetenv ("GTK_MENUPROXY");
718-+
719-+ module = ubuntu_menu_proxy_module_get ();
720-+ test_proxy_get_type (G_TYPE_MODULE (module));
721-+#endif
722-+
723-+ g_assert (ubuntu_menu_proxy_get_type () != 0);
724-+}
725-+
726-+static void
727-+can_instantiate_test (void)
728-+{
729-+ TestModule *module = test_module_new ();
730-+
731-+ g_type_module_use (G_TYPE_MODULE (module));
732-+
733-+ UbuntuMenuProxy *proxy = ubuntu_menu_proxy_get ();
734-+
735-+ g_assert (proxy != NULL);
736-+
737-+ g_object_ref_sink (proxy);
738-+
739-+ g_assert (TEST_IS_PROXY (proxy));
740-+ g_assert (UBUNTU_IS_MENU_PROXY (proxy));
741-+
742-+ g_object_unref (proxy);
743-+}
744-+
745-+int
746-+main (int argc, char *argv[])
747-+{
748-+ gtk_test_init (&argc, &argv);
749-+
750-+ g_test_add_func ("/proxy/null-proxy", null_proxy_test);
751-+ g_test_add_func ("/proxy/type-exists", proxy_type_exists_test);
752-+ g_test_add_func ("/proxy/can-instantiate", can_instantiate_test);
753-+ g_test_add_func ("/proxy/non-null-proxy", non_null_proxy_test);
754-+ g_test_add_func ("/proxy/menubar-signals-proxy", menubar_signals_proxy_test);
755-+
756-+ return g_test_run();
757-+}
758-Index: gtk+2.0-2.24.8/gtk/ubuntumenuproxy.c
759-===================================================================
760---- /dev/null 1970-01-01 00:00:00.000000000 +0000
761-+++ gtk+2.0-2.24.8/gtk/ubuntumenuproxy.c 2012-01-12 10:59:31.960859983 +0100
762-@@ -0,0 +1,249 @@
763-+/*
764-+ * Copyright (C) 2010 Canonical, Ltd.
765-+ *
766-+ * This library is free software; you can redistribute it and/or
767-+ * modify it under the terms of the GNU Lesser General Public
768-+ * License as published by the Free Software Foundation; either
769-+ * version 2 of the License, or (at your option) any later version.
770-+ *
771-+ * This library is distributed in the hope that it will be useful,
772-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
773-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
774-+ * Lesser General Public License for more details.
775-+ *
776-+ * You should have received a copy of the GNU Lesser General Public
777-+ * License along with this library; if not, write to the
778-+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
779-+ * Boston, MA 02111-1307, USA.
780-+ *
781-+ * Authors: Cody Russell <bratsche@gnome.org>
782-+ */
783-+
784-+#include "config.h"
785-+#include "gtkintl.h"
786-+#include "gtkmarshalers.h"
787-+#include "ubuntumenuproxy.h"
788-+#include "ubuntumenuproxymodule.h"
789-+#include "gtkmodules.h"
790-+#include "gtkprivate.h"
791-+#include "gtkalias.h"
792-+
793-+enum {
794-+ PROP_0,
795-+ PROP_SHOW_LOCAL
796-+};
797-+
798-+enum {
799-+ INSERTED,
800-+ LOCAL_NOTIFY,
801-+ ACTIVATE_MENU,
802-+ LAST_SIGNAL
803-+};
804-+
805-+#define UBUNTU_MENU_PROXY_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UBUNTU_TYPE_MENU_PROXY, UbuntuMenuProxyPrivate))
806-+
807-+typedef struct _UbuntuMenuProxyPrivate UbuntuMenuProxyPrivate;
808-+
809-+struct _UbuntuMenuProxyPrivate
810-+{
811-+ gboolean show_local;
812-+};
813-+
814-+static guint menu_proxy_signals[LAST_SIGNAL] = { 0 };
815-+static GObjectClass *parent_class = NULL;
816-+static UbuntuMenuProxy *proxy_singleton = NULL;
817-+
818-+static void ubuntu_menu_proxy_real_insert (UbuntuMenuProxy *proxy,
819-+ GtkWidget *parent,
820-+ GtkWidget *child,
821-+ guint position);
822-+static gboolean ubuntu_menu_proxy_real_show_local (UbuntuMenuProxy *proxy);
823-+
824-+
825-+
826-+/* --------------------------------------------------------- */
827-+
828-+G_DEFINE_TYPE (UbuntuMenuProxy, ubuntu_menu_proxy, G_TYPE_OBJECT)
829-+
830-+static GObject *
831-+ubuntu_menu_proxy_constructor (GType type,
832-+ guint n_params,
833-+ GObjectConstructParam *params)
834-+{
835-+ GObject *object;
836-+
837-+ if (proxy_singleton != NULL)
838-+ {
839-+ object = g_object_ref (proxy_singleton);
840-+ }
841-+ else
842-+ {
843-+ object = G_OBJECT_CLASS (ubuntu_menu_proxy_parent_class)->constructor (type,
844-+ n_params,
845-+ params);
846-+
847-+ proxy_singleton = UBUNTU_MENU_PROXY (object);
848-+ g_object_add_weak_pointer (object, (gpointer) &proxy_singleton);
849-+ }
850-+
851-+ return object;
852-+}
853-+
854-+static void
855-+ubuntu_menu_proxy_init (UbuntuMenuProxy *proxy)
856-+{
857-+}
858-+
859-+static void
860-+ubuntu_menu_proxy_get_property (GObject *object,
861-+ guint prop_id,
862-+ GValue *value,
863-+ GParamSpec *pspec)
864-+{
865-+ UbuntuMenuProxyPrivate *priv = UBUNTU_MENU_PROXY_GET_PRIVATE (object);
866-+
867-+ switch (prop_id)
868-+ {
869-+ case PROP_SHOW_LOCAL:
870-+ g_value_set_boolean (value, priv->show_local);
871-+ break;
872-+
873-+ default:
874-+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
875-+ break;
876-+ }
877-+}
878-+
879-+static void
880-+ubuntu_menu_proxy_set_property (GObject *object,
881-+ guint prop_id,
882-+ const GValue *value,
883-+ GParamSpec *pspec)
884-+{
885-+ UbuntuMenuProxyPrivate *priv = UBUNTU_MENU_PROXY_GET_PRIVATE (object);
886-+
887-+ switch (prop_id)
888-+ {
889-+ case PROP_SHOW_LOCAL:
890-+ priv->show_local = g_value_get_boolean (value);
891-+ g_signal_emit (object, menu_proxy_signals[LOCAL_NOTIFY], 0, priv->show_local);
892-+ break;
893-+
894-+ default:
895-+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
896-+ break;
897-+ }
898-+}
899-+
900-+static void
901-+ubuntu_menu_proxy_class_init (UbuntuMenuProxyClass *class)
902-+{
903-+ GObjectClass *object_class = G_OBJECT_CLASS (class);
904-+
905-+ parent_class = g_type_class_peek_parent (class);
906-+
907-+ object_class->get_property = ubuntu_menu_proxy_get_property;
908-+ object_class->set_property = ubuntu_menu_proxy_set_property;
909-+
910-+ g_object_class_install_property (object_class,
911-+ PROP_SHOW_LOCAL,
912-+ g_param_spec_boolean ("show-local",
913-+ P_("Show the local menu"),
914-+ P_("Whether the menu is displayed locally"),
915-+ FALSE,
916-+ GTK_PARAM_READWRITE));
917-+
918-+ menu_proxy_signals[INSERTED] =
919-+ g_signal_new (I_("inserted"),
920-+ G_TYPE_FROM_CLASS (class),
921-+ G_SIGNAL_RUN_LAST,
922-+ G_STRUCT_OFFSET (UbuntuMenuProxyClass, inserted),
923-+ NULL, NULL,
924-+ _gtk_marshal_VOID__OBJECT_UINT,
925-+ G_TYPE_NONE, 2,
926-+ GTK_TYPE_WIDGET, G_TYPE_UINT);
927-+
928-+ menu_proxy_signals[LOCAL_NOTIFY] =
929-+ g_signal_new (I_("local-notify"),
930-+ G_TYPE_FROM_CLASS (class),
931-+ G_SIGNAL_RUN_LAST,
932-+ NULL,
933-+ NULL, NULL,
934-+ _gtk_marshal_VOID__BOOLEAN,
935-+ G_TYPE_NONE, 1,
936-+ G_TYPE_BOOLEAN);
937-+
938-+ menu_proxy_signals[ACTIVATE_MENU] =
939-+ g_signal_new (I_("activate-menu"),
940-+ G_TYPE_FROM_CLASS (class),
941-+ G_SIGNAL_RUN_LAST,
942-+ NULL,
943-+ NULL, NULL,
944-+ _gtk_marshal_VOID__OBJECT,
945-+ G_TYPE_NONE, 1,
946-+ G_TYPE_OBJECT);
947-+
948-+ class->insert = ubuntu_menu_proxy_real_insert;
949-+ class->show_local = ubuntu_menu_proxy_real_show_local;
950-+
951-+ object_class->constructor = ubuntu_menu_proxy_constructor;
952-+
953-+ g_type_class_add_private (object_class, sizeof (UbuntuMenuProxyPrivate));
954-+}
955-+
956-+UbuntuMenuProxy *
957-+ubuntu_menu_proxy_get (void)
958-+{
959-+ if (!proxy_singleton)
960-+ {
961-+ ubuntu_menu_proxy_module_get ();
962-+ }
963-+
964-+ return proxy_singleton;
965-+}
966-+
967-+static void
968-+ubuntu_menu_proxy_real_insert (UbuntuMenuProxy *proxy,
969-+ GtkWidget *parent,
970-+ GtkWidget *child,
971-+ guint position)
972-+{
973-+}
974-+
975-+static gboolean
976-+ubuntu_menu_proxy_real_show_local (UbuntuMenuProxy *proxy)
977-+{
978-+ return TRUE;
979-+}
980-+
981-+void
982-+ubuntu_menu_proxy_insert (UbuntuMenuProxy *proxy,
983-+ GtkWidget *parent,
984-+ GtkWidget *child,
985-+ guint position)
986-+{
987-+ g_return_if_fail (UBUNTU_IS_MENU_PROXY (proxy));
988-+
989-+ UBUNTU_MENU_PROXY_GET_CLASS (proxy)->insert (proxy,
990-+ parent,
991-+ child,
992-+ position);
993-+}
994-+
995-+gboolean
996-+ubuntu_menu_proxy_show_local (UbuntuMenuProxy *proxy)
997-+{
998-+ g_return_val_if_fail (UBUNTU_IS_MENU_PROXY (proxy), TRUE);
999-+
1000-+ return UBUNTU_MENU_PROXY_GET_CLASS (proxy)->show_local (proxy);
1001-+}
1002-+
1003-+void
1004-+ubuntu_menu_proxy_activate_menu (UbuntuMenuProxy *proxy,
1005-+ GtkWidget *widget)
1006-+{
1007-+ g_signal_emit (proxy, menu_proxy_signals[ACTIVATE_MENU], 0, widget);
1008-+}
1009-+
1010-+#define __UBUNTU_MENU_PROXY_C__
1011-+#include "gtkaliasdef.c"
1012-Index: gtk+2.0-2.24.8/gtk/ubuntumenuproxy.h
1013-===================================================================
1014---- /dev/null 1970-01-01 00:00:00.000000000 +0000
1015-+++ gtk+2.0-2.24.8/gtk/ubuntumenuproxy.h 2012-01-12 10:59:31.960859983 +0100
1016-@@ -0,0 +1,74 @@
1017-+/*
1018-+ * Copyright (C) 2010 Canonical, Ltd.
1019-+ *
1020-+ * This library is free software; you can redistribute it and/or
1021-+ * modify it under the terms of the GNU Lesser General Public
1022-+ * License as published by the Free Software Foundation; either
1023-+ * version 2 of the License, or (at your option) any later version.
1024-+ *
1025-+ * This library is distributed in the hope that it will be useful,
1026-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
1027-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1028-+ * Lesser General Public License for more details.
1029-+ *
1030-+ * You should have received a copy of the GNU Lesser General Public
1031-+ * License along with this library; if not, write to the
1032-+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
1033-+ * Boston, MA 02111-1307, USA.
1034-+ *
1035-+ * Authors: Cody Russell <bratsche@gnome.org>
1036-+ */
1037-+
1038-+#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
1039-+#error "Only <gtk/gtk.h> can be included directly."
1040-+#endif
1041-+
1042-+#ifndef __UBUNTU_MENU_PROXY_H__
1043-+#define __UBUNTU_MENU_PROXY_H__
1044-+
1045-+#include <gtk/gtkwidget.h>
1046-+#include <gtk/gtktypeutils.h>
1047-+
1048-+G_BEGIN_DECLS
1049-+
1050-+#define UBUNTU_TYPE_MENU_PROXY (ubuntu_menu_proxy_get_type ())
1051-+#define UBUNTU_MENU_PROXY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), UBUNTU_TYPE_MENU_PROXY, UbuntuMenuProxy))
1052-+#define UBUNTU_MENU_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), UBUNTU_TYPE_MENU_PROXY, UbuntuMenuProxyClass))
1053-+#define UBUNTU_IS_MENU_PROXY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), UBUNTU_TYPE_MENU_PROXY))
1054-+#define UBUNTU_IS_MENU_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), UBUNTU_TYPE_MENU_PROXY))
1055-+#define UBUNTU_MENU_PROXY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), UBUNTU_TYPE_MENU_PROXY, UbuntuMenuProxyClass))
1056-+
1057-+
1058-+typedef struct _UbuntuMenuProxy UbuntuMenuProxy;
1059-+typedef struct _UbuntuMenuProxyClass UbuntuMenuProxyClass;
1060-+
1061-+struct _UbuntuMenuProxy
1062-+{
1063-+ GObject parent_object;
1064-+};
1065-+
1066-+struct _UbuntuMenuProxyClass
1067-+{
1068-+ GObjectClass parent_class;
1069-+
1070-+ /* vtable */
1071-+ void (* insert) (UbuntuMenuProxy *proxy, GtkWidget *parent, GtkWidget *child, guint position);
1072-+ gboolean (* show_local) (UbuntuMenuProxy *proxy);
1073-+
1074-+ /* signals */
1075-+ void (* inserted) (UbuntuMenuProxy *proxy, GtkWidget *child);
1076-+};
1077-+
1078-+GType ubuntu_menu_proxy_get_type (void) G_GNUC_CONST;
1079-+UbuntuMenuProxy* ubuntu_menu_proxy_get (void);
1080-+void ubuntu_menu_proxy_insert (UbuntuMenuProxy *proxy,
1081-+ GtkWidget *parent,
1082-+ GtkWidget *child,
1083-+ guint position);
1084-+gboolean ubuntu_menu_proxy_show_local (UbuntuMenuProxy *proxy);
1085-+void ubuntu_menu_proxy_activate_menu (UbuntuMenuProxy *proxy,
1086-+ GtkWidget *widget);
1087-+
1088-+G_END_DECLS
1089-+
1090-+#endif /* __UBUNTU_MENU_PROXY_H__ */
1091-Index: gtk+2.0-2.24.8/gtk/ubuntumenuproxymodule.c
1092-===================================================================
1093---- /dev/null 1970-01-01 00:00:00.000000000 +0000
1094-+++ gtk+2.0-2.24.8/gtk/ubuntumenuproxymodule.c 2012-01-12 10:59:31.964860005 +0100
1095-@@ -0,0 +1,212 @@
1096-+/*
1097-+ * Copyright (C) 2010 Canonical, Ltd.
1098-+ *
1099-+ * This library is free software; you can redistribute it and/or
1100-+ * modify it under the terms of the GNU Lesser General Public
1101-+ * License as published by the Free Software Foundation; either
1102-+ * version 2 of the License, or (at your option) any later version.
1103-+ *
1104-+ * This library is distributed in the hope that it will be useful,
1105-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
1106-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1107-+ * Lesser General Public License for more details.
1108-+ *
1109-+ * You should have received a copy of the GNU Lesser General Public
1110-+ * License along with this library; if not, write to the
1111-+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
1112-+ * Boston, MA 02111-1307, USA.
1113-+ *
1114-+ * Authors: Cody Russell <bratsche@gnome.org>
1115-+ */
1116-+
1117-+#include "config.h"
1118-+#include "gtkintl.h"
1119-+#include "ubuntumenuproxy.h"
1120-+#include "ubuntumenuproxymodule.h"
1121-+#include "gtkmodules.h"
1122-+#include "gtkalias.h"
1123-+
1124-+enum {
1125-+ PROP_0,
1126-+ PROP_MODULENAME
1127-+};
1128-+
1129-+static GObject *ubuntu_menu_proxy_module_constructor (GType type,
1130-+ guint n_params,
1131-+ GObjectConstructParam *params);
1132-+static void ubuntu_menu_proxy_module_finalize (GObject *object);
1133-+static gboolean ubuntu_menu_proxy_module_real_load (GTypeModule *gmodule);
1134-+static void ubuntu_menu_proxy_module_real_unload (GTypeModule *gmodule);
1135-+
1136-+
1137-+G_DEFINE_TYPE (UbuntuMenuProxyModule, ubuntu_menu_proxy_module, G_TYPE_TYPE_MODULE);
1138-+
1139-+static UbuntuMenuProxyModule *proxy_module_singleton = NULL;
1140-+
1141-+static void
1142-+ubuntu_menu_proxy_module_class_init (UbuntuMenuProxyModuleClass *class)
1143-+{
1144-+ GObjectClass *object_class = G_OBJECT_CLASS (class);
1145-+ GTypeModuleClass *type_module_class = G_TYPE_MODULE_CLASS (class);
1146-+
1147-+ object_class->finalize = ubuntu_menu_proxy_module_finalize;
1148-+
1149-+ type_module_class->load = ubuntu_menu_proxy_module_real_load;
1150-+ type_module_class->unload = ubuntu_menu_proxy_module_real_unload;
1151-+}
1152-+
1153-+static void
1154-+ubuntu_menu_proxy_module_init (UbuntuMenuProxyModule *module)
1155-+{
1156-+ module->name = g_strdup (g_getenv ("UBUNTU_MENUPROXY"));
1157-+ module->library = NULL;
1158-+ module->load = NULL;
1159-+ module->unload = NULL;
1160-+}
1161-+
1162-+static void
1163-+ubuntu_menu_proxy_module_finalize (GObject *object)
1164-+{
1165-+ UbuntuMenuProxyModule *module = UBUNTU_MENU_PROXY_MODULE (object);
1166-+
1167-+ if (module->name != NULL)
1168-+ {
1169-+ g_free (module->name);
1170-+ }
1171-+
1172-+ G_OBJECT_CLASS (ubuntu_menu_proxy_module_parent_class)->finalize (object);
1173-+}
1174-+
1175-+static gboolean
1176-+ubuntu_menu_proxy_module_real_load (GTypeModule *gmodule)
1177-+{
1178-+ UbuntuMenuProxyModule *module = UBUNTU_MENU_PROXY_MODULE (gmodule);
1179-+ gchar *path;
1180-+
1181-+ if (proxy_module_singleton != NULL)
1182-+ return TRUE;
1183-+
1184-+ if (!module->name)
1185-+ {
1186-+ g_warning ("Module path not set");
1187-+ return FALSE;
1188-+ }
1189-+
1190-+ path = _gtk_find_module (module->name, "menuproxies");
1191-+
1192-+ module->library = g_module_open (path, 0);
1193-+
1194-+ if (!module->library)
1195-+ {
1196-+ g_printerr ("%s\n", g_module_error ());
1197-+ return FALSE;
1198-+ }
1199-+
1200-+ /* Make sure that the loaded library contains the required methods */
1201-+ if (!g_module_symbol (module->library,
1202-+ "menu_proxy_module_load",
1203-+ (gpointer *) &module->load) ||
1204-+ !g_module_symbol (module->library,
1205-+ "menu_proxy_module_unload",
1206-+ (gpointer *) &module->unload))
1207-+ {
1208-+ g_printerr ("%s\n", g_module_error ());
1209-+ g_module_close (module->library);
1210-+
1211-+ return FALSE;
1212-+ }
1213-+
1214-+ /* Initialize the loaded module */
1215-+ module->load (module);
1216-+
1217-+ return TRUE;
1218-+}
1219-+
1220-+static void
1221-+ubuntu_menu_proxy_module_real_unload (GTypeModule *gmodule)
1222-+{
1223-+ UbuntuMenuProxyModule *module = UBUNTU_MENU_PROXY_MODULE (gmodule);
1224-+
1225-+ module->unload (module);
1226-+
1227-+ g_module_close (module->library);
1228-+ module->library = NULL;
1229-+
1230-+ module->load = NULL;
1231-+ module->unload = NULL;
1232-+}
1233-+
1234-+static gboolean
1235-+is_valid_module_name (const gchar *name)
1236-+{
1237-+#if !defined(G_OS_WIN32) && !defined(G_WITH_CYGWIN)
1238-+ return g_str_has_prefix (name, "lib") && g_str_has_suffix (name, ".so");
1239-+#else
1240-+ return g_str_has_suffix (name, ".dll");
1241-+#endif
1242-+}
1243-+
1244-+static void
1245-+setup_instance (UbuntuMenuProxyModule *module)
1246-+{
1247-+ GType *proxy_types;
1248-+ guint n_proxies;
1249-+
1250-+ proxy_types = g_type_children (UBUNTU_TYPE_MENU_PROXY,
1251-+ &n_proxies);
1252-+
1253-+ if (n_proxies > 1)
1254-+ {
1255-+ g_warning ("There are %d child types of UbuntuMenuProxy, should be 0 or 1.\n",
1256-+ n_proxies);
1257-+ }
1258-+ else if (n_proxies == 1)
1259-+ {
1260-+ g_object_new (proxy_types[0], NULL);
1261-+ }
1262-+}
1263-+
1264-+UbuntuMenuProxyModule *
1265-+ubuntu_menu_proxy_module_get (void)
1266-+{
1267-+ if (!proxy_module_singleton)
1268-+ {
1269-+ UbuntuMenuProxyModule *module = NULL;
1270-+ const gchar *module_name;
1271-+
1272-+ module_name = g_getenv ("UBUNTU_MENUPROXY");
1273-+
1274-+ if (module_name != NULL)
1275-+ {
1276-+ if (is_valid_module_name (module_name))
1277-+ {
1278-+ gchar *path = _gtk_find_module (module_name, "menuproxies");
1279-+
1280-+ module = g_object_new (UBUNTU_TYPE_MENU_PROXY_MODULE,
1281-+ NULL);
1282-+
1283-+ if (!g_type_module_use (G_TYPE_MODULE (module)))
1284-+ {
1285-+ g_warning ("Failed to load type module: %s\n", path);
1286-+
1287-+ g_object_unref (module);
1288-+ g_free (path);
1289-+
1290-+ return NULL;
1291-+ }
1292-+
1293-+ setup_instance (module);
1294-+
1295-+ g_free (path);
1296-+ g_type_module_unuse (G_TYPE_MODULE (module));
1297-+ }
1298-+
1299-+ proxy_module_singleton = module;
1300-+ }
1301-+ }
1302-+
1303-+ return proxy_module_singleton;
1304-+}
1305-+
1306-+#define __UBUNTU_MENU_PROXY_MODULE_C__
1307-+#include "gtkaliasdef.c"
1308-Index: gtk+2.0-2.24.8/gtk/ubuntumenuproxymodule.h
1309-===================================================================
1310---- /dev/null 1970-01-01 00:00:00.000000000 +0000
1311-+++ gtk+2.0-2.24.8/gtk/ubuntumenuproxymodule.h 2012-01-12 10:59:31.964860005 +0100
1312-@@ -0,0 +1,69 @@
1313-+/*
1314-+ * Copyright (C) 2010 Canonical, Ltd.
1315-+ *
1316-+ * This library is free software; you can redistribute it and/or
1317-+ * modify it under the terms of the GNU Lesser General Public
1318-+ * License as published by the Free Software Foundation; either
1319-+ * version 2 of the License, or (at your option) any later version.
1320-+ *
1321-+ * This library is distributed in the hope that it will be useful,
1322-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
1323-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1324-+ * Lesser General Public License for more details.
1325-+ *
1326-+ * You should have received a copy of the GNU Lesser General Public
1327-+ * License along with this library; if not, write to the
1328-+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
1329-+ * Boston, MA 02111-1307, USA.
1330-+ *
1331-+ * Authors: Cody Russell <bratsche@gnome.org>
1332-+ */
1333-+
1334-+#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
1335-+#error "Only <gtk/gtk.h> can be included directly."
1336-+#endif
1337-+
1338-+#ifndef __UBUNTU_MENU_PROXY_MODULE_H__
1339-+#define __UBUNTU_MENU_PROXY_MODULE_H__
1340-+
1341-+#include <glib-object.h>
1342-+#include <gmodule.h>
1343-+
1344-+G_BEGIN_DECLS
1345-+
1346-+#define UBUNTU_TYPE_MENU_PROXY_MODULE (ubuntu_menu_proxy_module_get_type ())
1347-+#define UBUNTU_MENU_PROXY_MODULE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), UBUNTU_TYPE_MENU_PROXY_MODULE, UbuntuMenuProxyModule))
1348-+#define UBUNTU_MENU_PROXY_MODULE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), UBUNTU_TYPE_MENU_PROXY_MODULE, UbuntuMenuProxyModuleClass))
1349-+#define UBUNTU_IS_MENU_MODULE_PROXY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), UBUNTU_TYPE_MENU_PROXY_MODULE))
1350-+#define UBUNTU_IS_MENU_PROXY_MODULE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), UBUNTU_TYPE_MENU_PROXY_MODULE))
1351-+#define UBUNTU_MENU_PROXY_MODULE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), UBUNTU_TYPE_MENU_PROXY_MODULE, UbuntuMenuProxyModuleClass))
1352-+
1353-+typedef struct _UbuntuMenuProxyModule UbuntuMenuProxyModule;
1354-+typedef struct _UbuntuMenuProxyModuleClass UbuntuMenuProxyModuleClass;
1355-+typedef struct _UbuntuMenuProxyModulePrivate UbuntuMenuProxyModulePrivate;
1356-+
1357-+struct _UbuntuMenuProxyModule
1358-+{
1359-+ GTypeModule parent_instance;
1360-+
1361-+ UbuntuMenuProxyModulePrivate *priv;
1362-+
1363-+ GModule *library;
1364-+ gchar *name;
1365-+
1366-+ void (* load) (UbuntuMenuProxyModule *module);
1367-+ void (* unload) (UbuntuMenuProxyModule *module);
1368-+};
1369-+
1370-+struct _UbuntuMenuProxyModuleClass
1371-+{
1372-+ GTypeModuleClass parent_class;
1373-+};
1374-+
1375-+GType ubuntu_menu_proxy_module_get_type (void) G_GNUC_CONST;
1376-+
1377-+UbuntuMenuProxyModule *ubuntu_menu_proxy_module_get (void);
1378-+
1379-+G_END_DECLS
1380-+
1381-+#endif /* __UBUNTU_MENU_PROXY_MODULE_H__ */
1382-Index: gtk+2.0-2.24.8/gtk/gtkwindow.c
1383-===================================================================
1384---- gtk+2.0-2.24.8.orig/gtk/gtkwindow.c 2012-01-12 10:59:29.868849616 +0100
1385-+++ gtk+2.0-2.24.8/gtk/gtkwindow.c 2012-01-12 10:59:31.968860029 +0100
1386-@@ -94,7 +94,8 @@
1387- PROP_GRAVITY,
1388- PROP_TRANSIENT_FOR,
1389- PROP_OPACITY,
1390--
1391-+ PROP_NO_PROXY,
1392-+
1393- /* Readonly properties */
1394- PROP_IS_ACTIVE,
1395- PROP_HAS_TOPLEVEL_FOCUS,
1396-@@ -195,6 +196,8 @@
1397-
1398- gdouble opacity;
1399-
1400-+ gboolean no_proxy;
1401-+
1402- gchar *startup_id;
1403- };
1404-
1405-@@ -502,6 +505,14 @@
1406- NULL,
1407- GTK_PARAM_READWRITE));
1408-
1409-+ g_object_class_install_property (object_class,
1410-+ PROP_NO_PROXY,
1411-+ g_param_spec_boolean ("ubuntu-no-proxy",
1412-+ P_("Disable menu proxies for this window"),
1413-+ P_("Disable menu proxies for this window"),
1414-+ FALSE,
1415-+ GTK_PARAM_READWRITE));
1416-+
1417- /**
1418- * GtkWindow:startup-id:
1419- *
1420-@@ -1084,6 +1095,9 @@
1421- case PROP_MNEMONICS_VISIBLE:
1422- gtk_window_set_mnemonics_visible (window, g_value_get_boolean (value));
1423- break;
1424-+ case PROP_NO_PROXY:
1425-+ priv->no_proxy = g_value_get_boolean (value);
1426-+ break;
1427- default:
1428- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
1429- break;
1430-@@ -1202,6 +1216,9 @@
1431- case PROP_MNEMONICS_VISIBLE:
1432- g_value_set_boolean (value, priv->mnemonics_visible);
1433- break;
1434-+ case PROP_NO_PROXY:
1435-+ g_value_set_boolean (value, priv->no_proxy);
1436-+ break;
1437- default:
1438- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
1439- break;
1440-Index: gtk+2.0-2.24.8/gtk/gtkmenuitem.c
1441-===================================================================
1442---- gtk+2.0-2.24.8.orig/gtk/gtkmenuitem.c 2012-01-12 10:59:29.848849513 +0100
1443-+++ gtk+2.0-2.24.8/gtk/gtkmenuitem.c 2012-01-12 10:59:31.968860029 +0100
1444-@@ -1395,7 +1395,17 @@
1445- widget);
1446- }
1447- else
1448-- g_signal_emit (widget, menu_item_signals[ACTIVATE_ITEM], 0);
1449-+ {
1450-+ if (GTK_IS_MENU_BAR (widget->parent) &&
1451-+ ubuntu_gtk_menu_shell_activate_mnemonic (GTK_MENU_SHELL (widget->parent), widget))
1452-+ {
1453-+ //g_print ("send activate to remote!\n");
1454-+ }
1455-+ else
1456-+ {
1457-+ g_signal_emit (widget, menu_item_signals[ACTIVATE_ITEM], 0);
1458-+ }
1459-+ }
1460-
1461- return TRUE;
1462- }
1463
1464=== removed file 'debian/patches/072_indicator_menu_update.patch'
1465--- debian/patches/072_indicator_menu_update.patch 2012-09-04 06:18:43 +0000
1466+++ debian/patches/072_indicator_menu_update.patch 1970-01-01 00:00:00 +0000
1467@@ -1,110 +0,0 @@
1468-## Description: Adding two signals that are needed for Application Indicator to
1469-## keep up-to-date with changed GtkMenu(Item)s.
1470-## Origin/Author: Cody Russell <bratsche@gnome.org>,
1471-## Sense Hofstede <sense@ubuntu.com>
1472-## Bug: unknown and https://launchpad.net/bug/608219
1473-Index: gtk+-2.24.12/gtk/gtkcontainer.c
1474-===================================================================
1475---- gtk+-2.24.12.orig/gtk/gtkcontainer.c 2011-08-16 14:30:52.000000000 +1200
1476-+++ gtk+-2.24.12/gtk/gtkcontainer.c 2012-09-04 16:42:52.074563931 +1200
1477-@@ -48,6 +48,8 @@
1478- REMOVE,
1479- CHECK_RESIZE,
1480- SET_FOCUS_CHILD,
1481-+ CHILD_ADDED,
1482-+ CHILD_REMOVED,
1483- LAST_SIGNAL
1484- };
1485-
1486-@@ -291,6 +293,24 @@
1487- _gtk_marshal_VOID__OBJECT,
1488- G_TYPE_NONE, 1,
1489- GTK_TYPE_WIDGET);
1490-+ container_signals[CHILD_ADDED] =
1491-+ g_signal_new (I_("child-added"),
1492-+ G_OBJECT_CLASS_TYPE (object_class),
1493-+ G_SIGNAL_RUN_LAST,
1494-+ 0,
1495-+ NULL, NULL,
1496-+ _gtk_marshal_VOID__OBJECT,
1497-+ G_TYPE_NONE, 1,
1498-+ GTK_TYPE_WIDGET);
1499-+ container_signals[CHILD_REMOVED] =
1500-+ g_signal_new (I_("child-removed"),
1501-+ G_OBJECT_CLASS_TYPE (object_class),
1502-+ G_SIGNAL_RUN_LAST,
1503-+ 0,
1504-+ NULL, NULL,
1505-+ _gtk_marshal_VOID__OBJECT,
1506-+ G_TYPE_NONE, 1,
1507-+ GTK_TYPE_WIDGET);
1508- }
1509-
1510- static void
1511-Index: gtk+-2.24.12/gtk/gtkmenushell.c
1512-===================================================================
1513---- gtk+-2.24.12.orig/gtk/gtkmenushell.c 2012-09-04 16:42:47.162564101 +1200
1514-+++ gtk+-2.24.12/gtk/gtkmenushell.c 2012-09-04 16:42:52.074563931 +1200
1515-@@ -559,6 +559,8 @@
1516- GTK_WIDGET (menu_shell),
1517- child,
1518- position);
1519-+
1520-+ g_signal_emit_by_name (menu_shell, "child-added", child);
1521- }
1522-
1523- static void
1524-Index: gtk+-2.24.12/gtk/gtkmenuitem.c
1525-===================================================================
1526---- gtk+-2.24.12.orig/gtk/gtkmenuitem.c 2012-09-04 16:42:45.278564166 +1200
1527-+++ gtk+-2.24.12/gtk/gtkmenuitem.c 2012-09-04 16:42:52.074563931 +1200
1528-@@ -52,6 +52,8 @@
1529- ACTIVATE_ITEM,
1530- TOGGLE_SIZE_REQUEST,
1531- TOGGLE_SIZE_ALLOCATE,
1532-+ SUBMENU_ADDED,
1533-+ SUBMENU_REMOVED,
1534- LAST_SIGNAL
1535- };
1536-
1537-@@ -244,6 +246,25 @@
1538- G_TYPE_NONE, 1,
1539- G_TYPE_INT);
1540-
1541-+ menu_item_signals[SUBMENU_ADDED] =
1542-+ g_signal_new (I_("submenu-added"),
1543-+ G_OBJECT_CLASS_TYPE (gobject_class),
1544-+ G_SIGNAL_RUN_FIRST,
1545-+ 0,
1546-+ NULL, NULL,
1547-+ _gtk_marshal_VOID__OBJECT,
1548-+ G_TYPE_NONE, 1,
1549-+ GTK_TYPE_WIDGET);
1550-+
1551-+ menu_item_signals[SUBMENU_REMOVED] =
1552-+ g_signal_new (I_("submenu-removed"),
1553-+ G_OBJECT_CLASS_TYPE (gobject_class),
1554-+ G_SIGNAL_RUN_FIRST,
1555-+ 0,
1556-+ NULL, NULL,
1557-+ _gtk_marshal_VOID__VOID,
1558-+ G_TYPE_NONE, 0);
1559-+
1560- /**
1561- * GtkMenuItem:right-justified:
1562- *
1563-@@ -791,6 +812,14 @@
1564- if (GTK_WIDGET (menu_item)->parent)
1565- gtk_widget_queue_resize (GTK_WIDGET (menu_item));
1566-
1567-+ if(submenu == NULL)
1568-+ {
1569-+ g_signal_emit_by_name (menu_item, "submenu-removed");
1570-+ }
1571-+ else
1572-+ {
1573-+ g_signal_emit_by_name (menu_item, "submenu-added", GTK_WIDGET(submenu));
1574-+ }
1575- g_object_notify (G_OBJECT (menu_item), "submenu");
1576- }
1577- }
1578
1579=== modified file 'debian/patches/series'
1580--- debian/patches/series 2013-02-25 01:18:07 +0000
1581+++ debian/patches/series 2013-03-04 21:20:34 +0000
1582@@ -4,12 +4,10 @@
1583 004_gtk+-ximian-gtk2-filesel-navbutton-5.patch
1584 005_support_disabling_x11_extensions.patch
1585 011_immodule-cache-dir.patch
1586-012_ubuntu-set-grab-add.patch
1587 015_default-fallback-icon-theme.patch
1588 022_disable-viqr-im-for-vi-locale.patch
1589 041_ia32-libs.patch
1590 042_treeview_single-focus.patch
1591-043_ubuntu_menu_proxy.patch
1592 044_tracker_fts.patch
1593 060_ignore-random-icons.patch
1594 061_use_pdf_as_default_printing_standard.patch
1595@@ -17,7 +15,6 @@
1596 063_treeview_almost_fixed.patch
1597 065_gir_set_packages.patch
1598 071_no_offscreen_widgets_grabbing.patch
1599-072_indicator_menu_update.patch
1600 090_logging_file_saves.patch
1601 092_default_to_xdg_document_dir.patch
1602 093_gtk3_gtkimage_fallbacks_use.patch

Subscribers

People subscribed via source and target branches

to all changes: