updated on Sat Jan 14 00:11:12 UTC 2012
[aur-mirror.git] / gtk2-ubuntu / 043_ubuntu_menu_proxy.patch
blob3248c1056d8c48eaaa8edc9d70a4b52b02224dec
1 ## Description: add some description
2 ## Origin/Author: add some origin or author
3 ## Bug: bug URL
4 Index: gtk+2.0-2.24.5/gtk/Makefile.am
5 ===================================================================
6 --- gtk+2.0-2.24.5.orig/gtk/Makefile.am 2011-07-19 09:10:44.000000000 -0400
7 +++ gtk+2.0-2.24.5/gtk/Makefile.am 2011-07-19 09:14:08.706398687 -0400
8 @@ -249,6 +249,8 @@
9 gtkmenu.h \
10 gtkmenubar.h \
11 gtkmenuitem.h \
12 + ubuntumenuproxy.h \
13 + ubuntumenuproxymodule.h \
14 gtkmenushell.h \
15 gtkmenutoolbutton.h \
16 gtkmessagedialog.h \
17 @@ -519,6 +521,8 @@
18 gtkmenu.c \
19 gtkmenubar.c \
20 gtkmenuitem.c \
21 + ubuntumenuproxy.c \
22 + ubuntumenuproxymodule.c \
23 gtkmenushell.c \
24 gtkmenutoolbutton.c \
25 gtkmessagedialog.c \
26 Index: gtk+2.0-2.24.5/gtk/gtk.h
27 ===================================================================
28 --- gtk+2.0-2.24.5.orig/gtk/gtk.h 2011-02-19 09:31:37.000000000 -0500
29 +++ gtk+2.0-2.24.5/gtk/gtk.h 2011-07-19 09:10:44.000000000 -0400
30 @@ -65,6 +65,8 @@
31 #include <gtk/gtkcellview.h>
32 #include <gtk/gtkcheckbutton.h>
33 #include <gtk/gtkcheckmenuitem.h>
34 +#include <gtk/ubuntumenuproxy.h>
35 +#include <gtk/ubuntumenuproxymodule.h>
36 #include <gtk/gtkclipboard.h>
37 #include <gtk/gtkcolorbutton.h>
38 #include <gtk/gtkcolorsel.h>
39 Index: gtk+2.0-2.24.5/gtk/gtk.symbols
40 ===================================================================
41 --- gtk+2.0-2.24.5.orig/gtk/gtk.symbols 2011-07-19 09:10:44.000000000 -0400
42 +++ gtk+2.0-2.24.5/gtk/gtk.symbols 2011-07-19 09:14:09.810398653 -0400
43 @@ -2606,6 +2606,21 @@
44 #endif
45 #endif
47 +#if IN_HEADER(__UBUNTU_MENU_PROXY_H__)
48 +#if IN_FILE(__UBUNTU_MENU_PROXY_C__)
49 +ubuntu_menu_proxy_get_type G_GNUC_CONST
50 +ubuntu_menu_proxy_get
51 +ubuntu_menu_proxy_insert
52 +#endif
53 +#endif
55 +#if IN_HEADER(__UBUNTU_MENU_PROXY_MODULE_H__)
56 +#if IN_FILE(__UBUNTU_MENU_PROXY_MODULE_C__)
57 +ubuntu_menu_proxy_module_get_type
58 +ubuntu_menu_proxy_module_get
59 +#endif
60 +#endif
62 #if IN_HEADER(__GTK_MENU_SHELL_H__)
63 #if IN_FILE(__GTK_MENU_SHELL_C__)
64 gtk_menu_shell_activate_item
65 @@ -2620,6 +2635,7 @@
66 gtk_menu_shell_select_item
67 gtk_menu_shell_set_take_focus
68 gtk_menu_shell_get_take_focus
69 +ubuntu_gtk_menu_shell_activate_mnemonic
70 #endif
71 #endif
73 Index: gtk+2.0-2.24.5/gtk/gtkmenubar.c
74 ===================================================================
75 --- gtk+2.0-2.24.5.orig/gtk/gtkmenubar.c 2011-02-19 09:31:37.000000000 -0500
76 +++ gtk+2.0-2.24.5/gtk/gtkmenubar.c 2011-07-19 10:09:40.706295821 -0400
77 @@ -107,7 +107,7 @@
78 widget_class->size_allocate = gtk_menu_bar_size_allocate;
79 widget_class->expose_event = gtk_menu_bar_expose;
80 widget_class->hierarchy_changed = gtk_menu_bar_hierarchy_changed;
83 menu_shell_class->submenu_placement = GTK_TOP_BOTTOM;
84 menu_shell_class->get_popup_delay = gtk_menu_bar_get_popup_delay;
85 menu_shell_class->move_current = gtk_menu_bar_move_current;
86 @@ -218,8 +218,37 @@
89 static void
90 +local_notify (GtkWidget *widget,
91 + GParamSpec *pspec,
92 + gpointer user_data)
94 + gboolean local;
96 + g_object_get (widget,
97 + "ubuntu-local", &local,
98 + NULL);
100 + gtk_widget_queue_resize (widget);
102 + /*
103 + if (local)
105 + gtk_widget_show (widget);
107 + else
109 + gtk_widget_hide (widget);
111 + */
114 +static void
115 gtk_menu_bar_init (GtkMenuBar *object)
117 + g_signal_connect (object,
118 + "notify::ubuntu-local",
119 + G_CALLBACK (local_notify),
120 + NULL);
123 GtkWidget*
124 @@ -284,13 +313,27 @@
125 gint nchildren;
126 GtkRequisition child_requisition;
127 gint ipadding;
128 + gboolean local = FALSE;
130 g_return_if_fail (GTK_IS_MENU_BAR (widget));
131 g_return_if_fail (requisition != NULL);
133 requisition->width = 0;
134 requisition->height = 0;
137 + g_object_get (widget,
138 + "ubuntu-local",
139 + &local,
140 + NULL);
142 + if (!local)
144 + requisition->width = 0;
145 + requisition->height = 0;
147 + return;
150 if (gtk_widget_get_visible (widget))
152 menu_bar = GTK_MENU_BAR (widget);
153 @@ -626,8 +669,15 @@
154 GtkMenuShell *menu_shell = GTK_MENU_SHELL (menubars->data);
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))
161 + //g_print ("send activate to remote!\n");
163 + else
165 + _gtk_menu_shell_activate (menu_shell);
166 + gtk_menu_shell_select_first (menu_shell, FALSE);
169 g_list_free (menubars);
171 Index: gtk+2.0-2.24.5/gtk/gtkmenushell.c
172 ===================================================================
173 --- gtk+2.0-2.24.5.orig/gtk/gtkmenushell.c 2011-02-19 09:31:37.000000000 -0500
174 +++ gtk+2.0-2.24.5/gtk/gtkmenushell.c 2011-07-19 10:09:14.650296626 -0400
175 @@ -37,6 +37,7 @@
176 #include "gtkmenubar.h"
177 #include "gtkmenuitem.h"
178 #include "gtkmenushell.h"
179 +#include "ubuntumenuproxy.h"
180 #include "gtkmnemonichash.h"
181 #include "gtktearoffmenuitem.h"
182 #include "gtkwindow.h"
183 @@ -64,7 +65,8 @@
185 enum {
186 PROP_0,
187 - PROP_TAKE_FOCUS
188 + PROP_TAKE_FOCUS,
189 + PROP_LOCAL
192 /* Terminology:
193 @@ -135,6 +137,9 @@
194 GtkMnemonicHash *mnemonic_hash;
195 GtkKeyHash *key_hash;
197 + UbuntuMenuProxy *proxy;
198 + gboolean local;
200 guint take_focus : 1;
201 guint activated_submenu : 1;
202 /* This flag is a crutch to keep mnemonics in the same menu
203 @@ -381,6 +386,14 @@
204 TRUE,
205 GTK_PARAM_READWRITE));
207 + g_object_class_install_property (object_class,
208 + PROP_LOCAL,
209 + g_param_spec_boolean ("ubuntu-local",
210 + P_("Local menu"),
211 + P_("Determines whether the menu is local"),
212 + FALSE,
213 + GTK_PARAM_READWRITE));
215 g_type_class_add_private (object_class, sizeof (GtkMenuShellPrivate));
218 @@ -391,6 +404,14 @@
221 static void
222 +show_local_notify (UbuntuMenuProxy *proxy,
223 + GParamSpec *pspec,
224 + GtkMenuShell *shell)
226 + g_object_notify (shell, "ubuntu-local");
229 +static void
230 gtk_menu_shell_init (GtkMenuShell *menu_shell)
232 GtkMenuShellPrivate *priv = GTK_MENU_SHELL_GET_PRIVATE (menu_shell);
233 @@ -408,6 +429,13 @@
234 priv->key_hash = NULL;
235 priv->take_focus = TRUE;
236 priv->activated_submenu = FALSE;
237 + priv->proxy = ubuntu_menu_proxy_get ();
238 + priv->local = FALSE;
240 + if (priv->proxy != NULL)
241 + g_signal_connect (priv->proxy, "notify::show-local",
242 + G_CALLBACK (show_local_notify),
243 + menu_shell);
246 static void
247 @@ -417,12 +445,16 @@
248 GParamSpec *pspec)
250 GtkMenuShell *menu_shell = GTK_MENU_SHELL (object);
251 + GtkMenuShellPrivate *priv = GTK_MENU_SHELL_GET_PRIVATE (object);
253 switch (prop_id)
255 case PROP_TAKE_FOCUS:
256 gtk_menu_shell_set_take_focus (menu_shell, g_value_get_boolean (value));
257 break;
258 + case PROP_LOCAL:
259 + priv->local = g_value_get_boolean (value);
260 + break;
261 default:
262 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
263 break;
264 @@ -436,12 +468,23 @@
265 GParamSpec *pspec)
267 GtkMenuShell *menu_shell = GTK_MENU_SHELL (object);
268 + GtkMenuShellPrivate *priv = GTK_MENU_SHELL_GET_PRIVATE (menu_shell);
269 + gboolean local;
271 switch (prop_id)
273 case PROP_TAKE_FOCUS:
274 g_value_set_boolean (value, gtk_menu_shell_get_take_focus (menu_shell));
275 break;
276 + case PROP_LOCAL:
277 + if (priv->proxy == NULL || ubuntu_menu_proxy_show_local (priv->proxy)) {
278 + local = TRUE;
279 + } else {
280 + local = priv->local;
283 + g_value_set_boolean (value, local);
284 + break;
285 default:
286 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
287 break;
288 @@ -454,6 +497,13 @@
289 GtkMenuShell *menu_shell = GTK_MENU_SHELL (object);
290 GtkMenuShellPrivate *priv = GTK_MENU_SHELL_GET_PRIVATE (menu_shell);
292 + if (priv->proxy != NULL)
294 + g_signal_handlers_disconnect_by_func (priv->proxy,
295 + show_local_notify,
296 + menu_shell);
299 if (priv->mnemonic_hash)
300 _gtk_mnemonic_hash_free (priv->mnemonic_hash);
301 if (priv->key_hash)
302 @@ -483,14 +533,24 @@
303 gint position)
305 GtkMenuShellClass *class;
306 + GtkMenuShellPrivate *priv;
308 g_return_if_fail (GTK_IS_MENU_SHELL (menu_shell));
309 g_return_if_fail (GTK_IS_MENU_ITEM (child));
311 class = GTK_MENU_SHELL_GET_CLASS (menu_shell);
313 + priv = GTK_MENU_SHELL_GET_PRIVATE (menu_shell);
315 if (class->insert)
316 class->insert (menu_shell, child, position);
318 + /* insert to proxy */
319 + if (priv->proxy != NULL)
320 + ubuntu_menu_proxy_insert (priv->proxy,
321 + GTK_WIDGET (menu_shell),
322 + child,
323 + position);
326 static void
327 @@ -1815,5 +1875,52 @@
331 +gboolean
332 +ubuntu_gtk_menu_shell_activate_mnemonic (GtkMenuShell *shell, GtkWidget *item)
334 + GtkMenuShellPrivate *priv;
336 + g_return_val_if_fail (GTK_IS_MENU_SHELL (shell), FALSE);
338 + priv = GTK_MENU_SHELL_GET_PRIVATE (shell);
340 + if (priv->proxy && !ubuntu_menu_proxy_show_local (priv->proxy))
342 + ubuntu_menu_proxy_activate_menu (priv->proxy,
343 + item);
345 + return TRUE;
348 + return FALSE;
351 +gboolean
352 +ubuntu_gtk_menu_shell_activate_first (GtkMenuShell *menu_shell,
353 + gboolean search_sensitive)
355 + GtkWidget *to_select = NULL;
356 + GList *tmp_list;
358 + tmp_list = menu_shell->children;
359 + while (tmp_list)
361 + GtkWidget *child = tmp_list->data;
363 + if ((!search_sensitive && gtk_widget_get_visible (child)) ||
364 + _gtk_menu_item_is_selectable (child))
366 + to_select = child;
367 + if (!GTK_IS_TEAROFF_MENU_ITEM (child))
368 + break;
371 + tmp_list = tmp_list->next;
374 + return to_select &&
375 + ubuntu_gtk_menu_shell_activate_mnemonic(menu_shell, to_select);
378 #define __GTK_MENU_SHELL_C__
379 #include "gtkaliasdef.c"
380 Index: gtk+2.0-2.24.5/gtk/tests/Makefile.am
381 ===================================================================
382 --- gtk+2.0-2.24.5.orig/gtk/tests/Makefile.am 2011-02-19 09:31:37.000000000 -0500
383 +++ gtk+2.0-2.24.5/gtk/tests/Makefile.am 2011-07-19 09:10:44.000000000 -0400
384 @@ -45,6 +45,10 @@
385 recentmanager_SOURCES = recentmanager.c
386 recentmanager_LDADD = $(progs_ldadd)
388 +TEST_PROGS += menuproxy
389 +menuproxy_SOURCES = menuproxy.c
390 +menuproxy_LDADD = $(progs_ldadd)
392 TEST_PROGS += floating
393 floating_SOURCES = floating.c
394 floating_LDADD = $(progs_ldadd)
395 Index: gtk+2.0-2.24.5/gtk/tests/menuproxy.c
396 ===================================================================
397 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
398 +++ gtk+2.0-2.24.5/gtk/tests/menuproxy.c 2011-07-19 09:10:44.000000000 -0400
399 @@ -0,0 +1,278 @@
401 + * Copyright (C) 2009 Canonical, Ltd.
403 + * This library is free software; you can redistribute it and/or
404 + * modify it under the terms of the GNU Lesser General Public
405 + * License as published by the Free Software Foundation; either
406 + * version 2 of the License, or (at your option) any later version.
408 + * This library is distributed in the hope that it will be useful,
409 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
410 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
411 + * Lesser General Public License for more details.
413 + * You should have received a copy of the GNU Lesser General Public
414 + * License along with this library; if not, write to the
415 + * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
416 + * Boston, MA 02111-1307, USA.
418 + * Authors: Cody Russell <bratsche@gnome.org>
419 + */
421 +#undef GTK_DISABLE_DEPRECATED
422 +#include "../gtk/gtk.h"
424 +typedef struct _TestProxy TestProxy;
425 +typedef struct _TestProxyClass TestProxyClass;
427 +//static GType test_proxy_type_id = 0;
428 +//static TestProxyClass *test_proxy_parent_class = NULL;
430 +#define TEST_TYPE_PROXY (test_proxy_type_id)
431 +#define TEST_PROXY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TEST_TYPE_PROXY, TestProxy))
432 +#define TEST_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), TEST_TYPE_PROXY, TestProxyClass))
433 +#define TEST_IS_PROXY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TEST_TYPE_PROXY))
435 +struct _TestProxy
437 + UbuntuMenuProxy parent_object;
440 +struct _TestProxyClass
442 + UbuntuMenuProxyClass parent_class;
445 +static void test_proxy_insert (UbuntuMenuProxy *proxy,
446 + GtkWidget *child,
447 + guint position);
449 +G_DEFINE_DYNAMIC_TYPE(TestProxy, test_proxy, UBUNTU_TYPE_MENU_PROXY)
451 +static void
452 +test_proxy_init (TestProxy *proxy)
456 +static void
457 +test_proxy_class_init (TestProxyClass *class)
459 + UbuntuMenuProxyClass *proxy_class = UBUNTU_MENU_PROXY_CLASS (class);
461 + test_proxy_parent_class = g_type_class_peek_parent (class);
463 + proxy_class->insert = test_proxy_insert;
466 +static void
467 +test_proxy_class_finalize (TestProxyClass *class)
471 +static void
472 +test_proxy_insert (UbuntuMenuProxy *proxy,
473 + GtkWidget *child,
474 + guint position)
478 +/* ---------------------------------------------------- */
480 +#define TEST_TYPE_MODULE (test_module_get_type ())
481 +#define TEST_MODULE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TEST_TYPE_MODULE, TestModule))
482 +#define TEST_MODULE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), TEST_TYPE_MODULE, TestModuleClass))
483 +#define TEST_IS_MODULE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TEST_TYPE_MODULE))
484 +#define TEST_IS_MODULE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), TEST_TYPE_MODULE))
485 +#define TEST_MODULE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TEST_TYPE_MODULE, TestModuleClass))
488 +typedef struct _TestModule TestModule;
489 +typedef struct _TestModuleClass TestModuleClass;
491 +struct _TestModule
493 + GTypeModule parent_instance;
496 +struct _TestModuleClass
498 + GTypeModuleClass parent_class;
501 +static gboolean
502 +test_module_load (GTypeModule *module)
504 + g_print ("registering type...\n");
505 + g_print (" type_id = %d\n", test_proxy_type_id);
507 + test_proxy_register_type (G_TYPE_MODULE (module));
509 + //test_proxy_get_type (G_TYPE_MODULE (module));
511 + g_print (" type_id = %d\n", test_proxy_type_id);
513 + return TRUE;
516 +static void
517 +test_module_unload (GTypeModule *module)
521 +static void
522 +test_module_class_init (TestModuleClass *class)
524 + GTypeModuleClass *type_module_class = G_TYPE_MODULE_CLASS (class);
526 + type_module_class->load = test_module_load;
527 + type_module_class->unload = test_module_unload;
530 +static void
531 +test_module_init (TestModule *module)
535 +G_DEFINE_TYPE (TestModule, test_module, G_TYPE_TYPE_MODULE);
537 +TestModule *
538 +test_module_new (void)
540 + TestModule *module = g_object_new (TEST_TYPE_MODULE,
541 + NULL);
543 + g_print ("test_module_new(): %p\n", module);
545 + return module;
549 +/* ---------------------------------------------------- */
551 +static void
552 +non_null_proxy_test (void)
554 + UbuntuMenuProxyModule *module;
556 + /* prevent the module loader from finding a proxy module */
557 + g_unsetenv ("UBUNTU_MENUPROXY");
559 + module = ubuntu_menu_proxy_module_get ();
560 + test_proxy_register_type (G_TYPE_MODULE (module));
561 + //test_proxy_get_type (G_TYPE_MODULE (module));
563 + GtkWidget *widget = g_object_new (GTK_TYPE_MENU_BAR, NULL);
564 + g_object_ref_sink (widget);
566 + g_assert (GTK_IS_MENU_BAR (widget));
567 + //g_assert (GTK_MENU_SHELL (widget)->proxy != NULL);
569 + g_object_unref (widget);
572 +static void
573 +null_proxy_test (void)
575 + GtkWidget *widget = g_object_new (GTK_TYPE_MENU_BAR, NULL);
576 + g_object_ref_sink (widget);
578 + g_assert (GTK_IS_MENU_BAR (widget));
580 + //g_assert (GTK_MENU_SHELL (widget)->proxy == NULL);
582 + g_object_unref (widget);
585 +static gboolean inserted_called = FALSE;
587 +static void
588 +inserted_cb (UbuntuMenuProxy *proxy,
589 + GtkWidget *child,
590 + guint position,
591 + gpointer data)
593 + g_return_if_fail (UBUNTU_IS_MENU_PROXY (proxy));
594 + g_return_if_fail (GTK_IS_WIDGET (child));
595 + inserted_called = TRUE;
598 +static void
599 +menubar_signals_proxy_test (void)
601 + GtkWidget *widget = NULL;
602 + GtkWidget *menuitem = NULL;
603 + UbuntuMenuProxy *proxy;
605 + //ubuntu_menu_proxy_register_type (test_proxy_get_type ());
607 + widget = g_object_new (GTK_TYPE_MENU_BAR, NULL);
608 + g_object_ref_sink (widget);
610 + g_assert (GTK_IS_MENU_BAR (widget));
611 + //g_assert (GTK_MENU_SHELL (widget)->proxy != NULL);
613 + /*
614 + proxy = GTK_MENU_SHELL (widget)->proxy;
616 + g_signal_connect (proxy,
617 + "inserted", G_CALLBACK (inserted_cb),
618 + NULL);
619 + */
621 + // insert menuitem
622 + menuitem = gtk_menu_item_new_with_label ("Test Item");
623 + gtk_menu_shell_append (GTK_MENU_SHELL (widget),
624 + menuitem);
626 + g_assert (inserted_called == TRUE);
628 + g_object_unref (widget);
631 +static void
632 +proxy_type_exists_test (void)
634 +#if 0
635 + UbuntuMenuProxyModule *module;
637 + g_unsetenv ("GTK_MENUPROXY");
639 + module = ubuntu_menu_proxy_module_get ();
640 + test_proxy_get_type (G_TYPE_MODULE (module));
641 +#endif
643 + g_assert (ubuntu_menu_proxy_get_type () != 0);
646 +static void
647 +can_instantiate_test (void)
649 + TestModule *module = test_module_new ();
651 + g_type_module_use (G_TYPE_MODULE (module));
653 + UbuntuMenuProxy *proxy = ubuntu_menu_proxy_get ();
655 + g_assert (proxy != NULL);
657 + g_object_ref_sink (proxy);
659 + g_assert (TEST_IS_PROXY (proxy));
660 + g_assert (UBUNTU_IS_MENU_PROXY (proxy));
662 + g_object_unref (proxy);
665 +int
666 +main (int argc, char *argv[])
668 + gtk_test_init (&argc, &argv);
670 + g_test_add_func ("/proxy/null-proxy", null_proxy_test);
671 + g_test_add_func ("/proxy/type-exists", proxy_type_exists_test);
672 + g_test_add_func ("/proxy/can-instantiate", can_instantiate_test);
673 + g_test_add_func ("/proxy/non-null-proxy", non_null_proxy_test);
674 + g_test_add_func ("/proxy/menubar-signals-proxy", menubar_signals_proxy_test);
676 + return g_test_run();
678 Index: gtk+2.0-2.24.5/gtk/ubuntumenuproxy.c
679 ===================================================================
680 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
681 +++ gtk+2.0-2.24.5/gtk/ubuntumenuproxy.c 2011-07-19 09:10:44.000000000 -0400
682 @@ -0,0 +1,249 @@
684 + * Copyright (C) 2010 Canonical, Ltd.
686 + * This library is free software; you can redistribute it and/or
687 + * modify it under the terms of the GNU Lesser General Public
688 + * License as published by the Free Software Foundation; either
689 + * version 2 of the License, or (at your option) any later version.
691 + * This library is distributed in the hope that it will be useful,
692 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
693 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
694 + * Lesser General Public License for more details.
696 + * You should have received a copy of the GNU Lesser General Public
697 + * License along with this library; if not, write to the
698 + * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
699 + * Boston, MA 02111-1307, USA.
701 + * Authors: Cody Russell <bratsche@gnome.org>
702 + */
704 +#include "config.h"
705 +#include "gtkintl.h"
706 +#include "gtkmarshalers.h"
707 +#include "ubuntumenuproxy.h"
708 +#include "ubuntumenuproxymodule.h"
709 +#include "gtkmodules.h"
710 +#include "gtkprivate.h"
711 +#include "gtkalias.h"
713 +enum {
714 + PROP_0,
715 + PROP_SHOW_LOCAL
718 +enum {
719 + INSERTED,
720 + LOCAL_NOTIFY,
721 + ACTIVATE_MENU,
722 + LAST_SIGNAL
725 +#define UBUNTU_MENU_PROXY_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UBUNTU_TYPE_MENU_PROXY, UbuntuMenuProxyPrivate))
727 +typedef struct _UbuntuMenuProxyPrivate UbuntuMenuProxyPrivate;
729 +struct _UbuntuMenuProxyPrivate
731 + gboolean show_local;
734 +static guint menu_proxy_signals[LAST_SIGNAL] = { 0 };
735 +static GObjectClass *parent_class = NULL;
736 +static UbuntuMenuProxy *proxy_singleton = NULL;
738 +static void ubuntu_menu_proxy_real_insert (UbuntuMenuProxy *proxy,
739 + GtkWidget *parent,
740 + GtkWidget *child,
741 + guint position);
742 +static gboolean ubuntu_menu_proxy_real_show_local (UbuntuMenuProxy *proxy);
746 +/* --------------------------------------------------------- */
748 +G_DEFINE_TYPE (UbuntuMenuProxy, ubuntu_menu_proxy, G_TYPE_OBJECT)
750 +static GObject *
751 +ubuntu_menu_proxy_constructor (GType type,
752 + guint n_params,
753 + GObjectConstructParam *params)
755 + GObject *object;
757 + if (proxy_singleton != NULL)
759 + object = g_object_ref (proxy_singleton);
761 + else
763 + object = G_OBJECT_CLASS (ubuntu_menu_proxy_parent_class)->constructor (type,
764 + n_params,
765 + params);
767 + proxy_singleton = UBUNTU_MENU_PROXY (object);
768 + g_object_add_weak_pointer (object, (gpointer) &proxy_singleton);
771 + return object;
774 +static void
775 +ubuntu_menu_proxy_init (UbuntuMenuProxy *proxy)
779 +static void
780 +ubuntu_menu_proxy_get_property (GObject *object,
781 + guint prop_id,
782 + GValue *value,
783 + GParamSpec *pspec)
785 + UbuntuMenuProxyPrivate *priv = UBUNTU_MENU_PROXY_GET_PRIVATE (object);
787 + switch (prop_id)
789 + case PROP_SHOW_LOCAL:
790 + g_value_set_boolean (value, priv->show_local);
791 + break;
793 + default:
794 + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
795 + break;
799 +static void
800 +ubuntu_menu_proxy_set_property (GObject *object,
801 + guint prop_id,
802 + const GValue *value,
803 + GParamSpec *pspec)
805 + UbuntuMenuProxyPrivate *priv = UBUNTU_MENU_PROXY_GET_PRIVATE (object);
807 + switch (prop_id)
809 + case PROP_SHOW_LOCAL:
810 + priv->show_local = g_value_get_boolean (value);
811 + g_signal_emit (object, menu_proxy_signals[LOCAL_NOTIFY], 0, priv->show_local);
812 + break;
814 + default:
815 + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
816 + break;
820 +static void
821 +ubuntu_menu_proxy_class_init (UbuntuMenuProxyClass *class)
823 + GObjectClass *object_class = G_OBJECT_CLASS (class);
825 + parent_class = g_type_class_peek_parent (class);
827 + object_class->get_property = ubuntu_menu_proxy_get_property;
828 + object_class->set_property = ubuntu_menu_proxy_set_property;
830 + g_object_class_install_property (object_class,
831 + PROP_SHOW_LOCAL,
832 + g_param_spec_boolean ("show-local",
833 + P_("Show the local menu"),
834 + P_("Whether the menu is displayed locally"),
835 + FALSE,
836 + GTK_PARAM_READWRITE));
838 + menu_proxy_signals[INSERTED] =
839 + g_signal_new (I_("inserted"),
840 + G_TYPE_FROM_CLASS (class),
841 + G_SIGNAL_RUN_LAST,
842 + G_STRUCT_OFFSET (UbuntuMenuProxyClass, inserted),
843 + NULL, NULL,
844 + _gtk_marshal_VOID__OBJECT_UINT,
845 + G_TYPE_NONE, 2,
846 + GTK_TYPE_WIDGET, G_TYPE_UINT);
848 + menu_proxy_signals[LOCAL_NOTIFY] =
849 + g_signal_new (I_("local-notify"),
850 + G_TYPE_FROM_CLASS (class),
851 + G_SIGNAL_RUN_LAST,
852 + NULL,
853 + NULL, NULL,
854 + _gtk_marshal_VOID__BOOLEAN,
855 + G_TYPE_NONE, 1,
856 + G_TYPE_BOOLEAN);
858 + menu_proxy_signals[ACTIVATE_MENU] =
859 + g_signal_new (I_("activate-menu"),
860 + G_TYPE_FROM_CLASS (class),
861 + G_SIGNAL_RUN_LAST,
862 + NULL,
863 + NULL, NULL,
864 + _gtk_marshal_VOID__OBJECT,
865 + G_TYPE_NONE, 1,
866 + G_TYPE_OBJECT);
868 + class->insert = ubuntu_menu_proxy_real_insert;
869 + class->show_local = ubuntu_menu_proxy_real_show_local;
871 + object_class->constructor = ubuntu_menu_proxy_constructor;
873 + g_type_class_add_private (object_class, sizeof (UbuntuMenuProxyPrivate));
876 +UbuntuMenuProxy *
877 +ubuntu_menu_proxy_get (void)
879 + if (!proxy_singleton)
881 + ubuntu_menu_proxy_module_get ();
884 + return proxy_singleton;
887 +static void
888 +ubuntu_menu_proxy_real_insert (UbuntuMenuProxy *proxy,
889 + GtkWidget *parent,
890 + GtkWidget *child,
891 + guint position)
895 +static gboolean
896 +ubuntu_menu_proxy_real_show_local (UbuntuMenuProxy *proxy)
898 + return TRUE;
901 +void
902 +ubuntu_menu_proxy_insert (UbuntuMenuProxy *proxy,
903 + GtkWidget *parent,
904 + GtkWidget *child,
905 + guint position)
907 + g_return_if_fail (UBUNTU_IS_MENU_PROXY (proxy));
909 + UBUNTU_MENU_PROXY_GET_CLASS (proxy)->insert (proxy,
910 + parent,
911 + child,
912 + position);
915 +gboolean
916 +ubuntu_menu_proxy_show_local (UbuntuMenuProxy *proxy)
918 + g_return_val_if_fail (UBUNTU_IS_MENU_PROXY (proxy), TRUE);
920 + return UBUNTU_MENU_PROXY_GET_CLASS (proxy)->show_local (proxy);
923 +void
924 +ubuntu_menu_proxy_activate_menu (UbuntuMenuProxy *proxy,
925 + GtkWidget *widget)
927 + g_signal_emit (proxy, menu_proxy_signals[ACTIVATE_MENU], 0, widget);
930 +#define __UBUNTU_MENU_PROXY_C__
931 +#include "gtkaliasdef.c"
932 Index: gtk+2.0-2.24.5/gtk/ubuntumenuproxy.h
933 ===================================================================
934 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
935 +++ gtk+2.0-2.24.5/gtk/ubuntumenuproxy.h 2011-07-19 09:10:44.000000000 -0400
936 @@ -0,0 +1,74 @@
938 + * Copyright (C) 2010 Canonical, Ltd.
940 + * This library is free software; you can redistribute it and/or
941 + * modify it under the terms of the GNU Lesser General Public
942 + * License as published by the Free Software Foundation; either
943 + * version 2 of the License, or (at your option) any later version.
945 + * This library is distributed in the hope that it will be useful,
946 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
947 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
948 + * Lesser General Public License for more details.
950 + * You should have received a copy of the GNU Lesser General Public
951 + * License along with this library; if not, write to the
952 + * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
953 + * Boston, MA 02111-1307, USA.
955 + * Authors: Cody Russell <bratsche@gnome.org>
956 + */
958 +#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
959 +#error "Only <gtk/gtk.h> can be included directly."
960 +#endif
962 +#ifndef __UBUNTU_MENU_PROXY_H__
963 +#define __UBUNTU_MENU_PROXY_H__
965 +#include <gtk/gtkwidget.h>
966 +#include <gtk/gtktypeutils.h>
968 +G_BEGIN_DECLS
970 +#define UBUNTU_TYPE_MENU_PROXY (ubuntu_menu_proxy_get_type ())
971 +#define UBUNTU_MENU_PROXY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), UBUNTU_TYPE_MENU_PROXY, UbuntuMenuProxy))
972 +#define UBUNTU_MENU_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), UBUNTU_TYPE_MENU_PROXY, UbuntuMenuProxyClass))
973 +#define UBUNTU_IS_MENU_PROXY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), UBUNTU_TYPE_MENU_PROXY))
974 +#define UBUNTU_IS_MENU_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), UBUNTU_TYPE_MENU_PROXY))
975 +#define UBUNTU_MENU_PROXY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), UBUNTU_TYPE_MENU_PROXY, UbuntuMenuProxyClass))
978 +typedef struct _UbuntuMenuProxy UbuntuMenuProxy;
979 +typedef struct _UbuntuMenuProxyClass UbuntuMenuProxyClass;
981 +struct _UbuntuMenuProxy
983 + GObject parent_object;
986 +struct _UbuntuMenuProxyClass
988 + GObjectClass parent_class;
990 + /* vtable */
991 + void (* insert) (UbuntuMenuProxy *proxy, GtkWidget *parent, GtkWidget *child, guint position);
992 + gboolean (* show_local) (UbuntuMenuProxy *proxy);
994 + /* signals */
995 + void (* inserted) (UbuntuMenuProxy *proxy, GtkWidget *child);
998 +GType ubuntu_menu_proxy_get_type (void) G_GNUC_CONST;
999 +UbuntuMenuProxy* ubuntu_menu_proxy_get (void);
1000 +void ubuntu_menu_proxy_insert (UbuntuMenuProxy *proxy,
1001 + GtkWidget *parent,
1002 + GtkWidget *child,
1003 + guint position);
1004 +gboolean ubuntu_menu_proxy_show_local (UbuntuMenuProxy *proxy);
1005 +void ubuntu_menu_proxy_activate_menu (UbuntuMenuProxy *proxy,
1006 + GtkWidget *widget);
1008 +G_END_DECLS
1010 +#endif /* __UBUNTU_MENU_PROXY_H__ */
1011 Index: gtk+2.0-2.24.5/gtk/ubuntumenuproxymodule.c
1012 ===================================================================
1013 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
1014 +++ gtk+2.0-2.24.5/gtk/ubuntumenuproxymodule.c 2011-07-19 09:10:44.000000000 -0400
1015 @@ -0,0 +1,212 @@
1017 + * Copyright (C) 2010 Canonical, Ltd.
1019 + * This library is free software; you can redistribute it and/or
1020 + * modify it under the terms of the GNU Lesser General Public
1021 + * License as published by the Free Software Foundation; either
1022 + * version 2 of the License, or (at your option) any later version.
1024 + * This library is distributed in the hope that it will be useful,
1025 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
1026 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1027 + * Lesser General Public License for more details.
1029 + * You should have received a copy of the GNU Lesser General Public
1030 + * License along with this library; if not, write to the
1031 + * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
1032 + * Boston, MA 02111-1307, USA.
1034 + * Authors: Cody Russell <bratsche@gnome.org>
1035 + */
1037 +#include "config.h"
1038 +#include "gtkintl.h"
1039 +#include "ubuntumenuproxy.h"
1040 +#include "ubuntumenuproxymodule.h"
1041 +#include "gtkmodules.h"
1042 +#include "gtkalias.h"
1044 +enum {
1045 + PROP_0,
1046 + PROP_MODULENAME
1049 +static GObject *ubuntu_menu_proxy_module_constructor (GType type,
1050 + guint n_params,
1051 + GObjectConstructParam *params);
1052 +static void ubuntu_menu_proxy_module_finalize (GObject *object);
1053 +static gboolean ubuntu_menu_proxy_module_real_load (GTypeModule *gmodule);
1054 +static void ubuntu_menu_proxy_module_real_unload (GTypeModule *gmodule);
1057 +G_DEFINE_TYPE (UbuntuMenuProxyModule, ubuntu_menu_proxy_module, G_TYPE_TYPE_MODULE);
1059 +static UbuntuMenuProxyModule *proxy_module_singleton = NULL;
1061 +static void
1062 +ubuntu_menu_proxy_module_class_init (UbuntuMenuProxyModuleClass *class)
1064 + GObjectClass *object_class = G_OBJECT_CLASS (class);
1065 + GTypeModuleClass *type_module_class = G_TYPE_MODULE_CLASS (class);
1067 + object_class->finalize = ubuntu_menu_proxy_module_finalize;
1069 + type_module_class->load = ubuntu_menu_proxy_module_real_load;
1070 + type_module_class->unload = ubuntu_menu_proxy_module_real_unload;
1073 +static void
1074 +ubuntu_menu_proxy_module_init (UbuntuMenuProxyModule *module)
1076 + module->name = g_strdup (g_getenv ("UBUNTU_MENUPROXY"));
1077 + module->library = NULL;
1078 + module->load = NULL;
1079 + module->unload = NULL;
1082 +static void
1083 +ubuntu_menu_proxy_module_finalize (GObject *object)
1085 + UbuntuMenuProxyModule *module = UBUNTU_MENU_PROXY_MODULE (object);
1087 + if (module->name != NULL)
1089 + g_free (module->name);
1092 + G_OBJECT_CLASS (ubuntu_menu_proxy_module_parent_class)->finalize (object);
1095 +static gboolean
1096 +ubuntu_menu_proxy_module_real_load (GTypeModule *gmodule)
1098 + UbuntuMenuProxyModule *module = UBUNTU_MENU_PROXY_MODULE (gmodule);
1099 + gchar *path;
1101 + if (proxy_module_singleton != NULL)
1102 + return TRUE;
1104 + if (!module->name)
1106 + g_warning ("Module path not set");
1107 + return FALSE;
1110 + path = _gtk_find_module (module->name, "menuproxies");
1112 + module->library = g_module_open (path, 0);
1114 + if (!module->library)
1116 + g_printerr ("%s\n", g_module_error ());
1117 + return FALSE;
1120 + /* Make sure that the loaded library contains the required methods */
1121 + if (!g_module_symbol (module->library,
1122 + "menu_proxy_module_load",
1123 + (gpointer *) &module->load) ||
1124 + !g_module_symbol (module->library,
1125 + "menu_proxy_module_unload",
1126 + (gpointer *) &module->unload))
1128 + g_printerr ("%s\n", g_module_error ());
1129 + g_module_close (module->library);
1131 + return FALSE;
1134 + /* Initialize the loaded module */
1135 + module->load (module);
1137 + return TRUE;
1140 +static void
1141 +ubuntu_menu_proxy_module_real_unload (GTypeModule *gmodule)
1143 + UbuntuMenuProxyModule *module = UBUNTU_MENU_PROXY_MODULE (gmodule);
1145 + module->unload (module);
1147 + g_module_close (module->library);
1148 + module->library = NULL;
1150 + module->load = NULL;
1151 + module->unload = NULL;
1154 +static gboolean
1155 +is_valid_module_name (const gchar *name)
1157 +#if !defined(G_OS_WIN32) && !defined(G_WITH_CYGWIN)
1158 + return g_str_has_prefix (name, "lib") && g_str_has_suffix (name, ".so");
1159 +#else
1160 + return g_str_has_suffix (name, ".dll");
1161 +#endif
1164 +static void
1165 +setup_instance (UbuntuMenuProxyModule *module)
1167 + GType *proxy_types;
1168 + guint n_proxies;
1170 + proxy_types = g_type_children (UBUNTU_TYPE_MENU_PROXY,
1171 + &n_proxies);
1173 + if (n_proxies > 1)
1175 + g_warning ("There are %d child types of UbuntuMenuProxy, should be 0 or 1.\n",
1176 + n_proxies);
1178 + else if (n_proxies == 1)
1180 + g_object_new (proxy_types[0], NULL);
1184 +UbuntuMenuProxyModule *
1185 +ubuntu_menu_proxy_module_get (void)
1187 + if (!proxy_module_singleton)
1189 + UbuntuMenuProxyModule *module = NULL;
1190 + const gchar *module_name;
1192 + module_name = g_getenv ("UBUNTU_MENUPROXY");
1194 + if (module_name != NULL)
1196 + if (is_valid_module_name (module_name))
1198 + gchar *path = _gtk_find_module (module_name, "menuproxies");
1200 + module = g_object_new (UBUNTU_TYPE_MENU_PROXY_MODULE,
1201 + NULL);
1203 + if (!g_type_module_use (G_TYPE_MODULE (module)))
1205 + g_warning ("Failed to load type module: %s\n", path);
1207 + g_object_unref (module);
1208 + g_free (path);
1210 + return NULL;
1213 + setup_instance (module);
1215 + g_free (path);
1216 + g_type_module_unuse (G_TYPE_MODULE (module));
1219 + proxy_module_singleton = module;
1223 + return proxy_module_singleton;
1226 +#define __UBUNTU_MENU_PROXY_MODULE_C__
1227 +#include "gtkaliasdef.c"
1228 Index: gtk+2.0-2.24.5/gtk/ubuntumenuproxymodule.h
1229 ===================================================================
1230 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
1231 +++ gtk+2.0-2.24.5/gtk/ubuntumenuproxymodule.h 2011-07-19 09:10:44.000000000 -0400
1232 @@ -0,0 +1,69 @@
1234 + * Copyright (C) 2010 Canonical, Ltd.
1236 + * This library is free software; you can redistribute it and/or
1237 + * modify it under the terms of the GNU Lesser General Public
1238 + * License as published by the Free Software Foundation; either
1239 + * version 2 of the License, or (at your option) any later version.
1241 + * This library is distributed in the hope that it will be useful,
1242 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
1243 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1244 + * Lesser General Public License for more details.
1246 + * You should have received a copy of the GNU Lesser General Public
1247 + * License along with this library; if not, write to the
1248 + * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
1249 + * Boston, MA 02111-1307, USA.
1251 + * Authors: Cody Russell <bratsche@gnome.org>
1252 + */
1254 +#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
1255 +#error "Only <gtk/gtk.h> can be included directly."
1256 +#endif
1258 +#ifndef __UBUNTU_MENU_PROXY_MODULE_H__
1259 +#define __UBUNTU_MENU_PROXY_MODULE_H__
1261 +#include <glib-object.h>
1262 +#include <gmodule.h>
1264 +G_BEGIN_DECLS
1266 +#define UBUNTU_TYPE_MENU_PROXY_MODULE (ubuntu_menu_proxy_module_get_type ())
1267 +#define UBUNTU_MENU_PROXY_MODULE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), UBUNTU_TYPE_MENU_PROXY_MODULE, UbuntuMenuProxyModule))
1268 +#define UBUNTU_MENU_PROXY_MODULE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), UBUNTU_TYPE_MENU_PROXY_MODULE, UbuntuMenuProxyModuleClass))
1269 +#define UBUNTU_IS_MENU_MODULE_PROXY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), UBUNTU_TYPE_MENU_PROXY_MODULE))
1270 +#define UBUNTU_IS_MENU_PROXY_MODULE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), UBUNTU_TYPE_MENU_PROXY_MODULE))
1271 +#define UBUNTU_MENU_PROXY_MODULE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), UBUNTU_TYPE_MENU_PROXY_MODULE, UbuntuMenuProxyModuleClass))
1273 +typedef struct _UbuntuMenuProxyModule UbuntuMenuProxyModule;
1274 +typedef struct _UbuntuMenuProxyModuleClass UbuntuMenuProxyModuleClass;
1275 +typedef struct _UbuntuMenuProxyModulePrivate UbuntuMenuProxyModulePrivate;
1277 +struct _UbuntuMenuProxyModule
1279 + GTypeModule parent_instance;
1281 + UbuntuMenuProxyModulePrivate *priv;
1283 + GModule *library;
1284 + gchar *name;
1286 + void (* load) (UbuntuMenuProxyModule *module);
1287 + void (* unload) (UbuntuMenuProxyModule *module);
1290 +struct _UbuntuMenuProxyModuleClass
1292 + GTypeModuleClass parent_class;
1295 +GType ubuntu_menu_proxy_module_get_type (void) G_GNUC_CONST;
1297 +UbuntuMenuProxyModule *ubuntu_menu_proxy_module_get (void);
1299 +G_END_DECLS
1301 +#endif /* __UBUNTU_MENU_PROXY_MODULE_H__ */
1302 Index: gtk+2.0-2.24.5/gtk/gtkwindow.c
1303 ===================================================================
1304 --- gtk+2.0-2.24.5.orig/gtk/gtkwindow.c 2011-06-15 18:37:19.000000000 -0400
1305 +++ gtk+2.0-2.24.5/gtk/gtkwindow.c 2011-07-19 09:14:09.882398651 -0400
1306 @@ -94,7 +94,8 @@
1307 PROP_GRAVITY,
1308 PROP_TRANSIENT_FOR,
1309 PROP_OPACITY,
1311 + PROP_NO_PROXY,
1313 /* Readonly properties */
1314 PROP_IS_ACTIVE,
1315 PROP_HAS_TOPLEVEL_FOCUS,
1316 @@ -195,6 +196,8 @@
1318 gdouble opacity;
1320 + gboolean no_proxy;
1322 gchar *startup_id;
1325 @@ -502,6 +505,14 @@
1326 NULL,
1327 GTK_PARAM_READWRITE));
1329 + g_object_class_install_property (object_class,
1330 + PROP_NO_PROXY,
1331 + g_param_spec_boolean ("ubuntu-no-proxy",
1332 + P_("Disable menu proxies for this window"),
1333 + P_("Disable menu proxies for this window"),
1334 + FALSE,
1335 + GTK_PARAM_READWRITE));
1338 * GtkWindow:startup-id:
1340 @@ -1084,6 +1095,9 @@
1341 case PROP_MNEMONICS_VISIBLE:
1342 gtk_window_set_mnemonics_visible (window, g_value_get_boolean (value));
1343 break;
1344 + case PROP_NO_PROXY:
1345 + priv->no_proxy = g_value_get_boolean (value);
1346 + break;
1347 default:
1348 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
1349 break;
1350 @@ -1202,6 +1216,9 @@
1351 case PROP_MNEMONICS_VISIBLE:
1352 g_value_set_boolean (value, priv->mnemonics_visible);
1353 break;
1354 + case PROP_NO_PROXY:
1355 + g_value_set_boolean (value, priv->no_proxy);
1356 + break;
1357 default:
1358 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
1359 break;
1360 Index: gtk+2.0-2.24.5/gtk/gtkmenuitem.c
1361 ===================================================================
1362 --- gtk+2.0-2.24.5.orig/gtk/gtkmenuitem.c 2011-06-15 18:37:19.000000000 -0400
1363 +++ gtk+2.0-2.24.5/gtk/gtkmenuitem.c 2011-07-19 09:14:08.346398698 -0400
1364 @@ -1395,7 +1395,17 @@
1365 widget);
1367 else
1368 - g_signal_emit (widget, menu_item_signals[ACTIVATE_ITEM], 0);
1370 + if (GTK_IS_MENU_BAR (widget->parent) &&
1371 + ubuntu_gtk_menu_shell_activate_mnemonic (GTK_MENU_SHELL (widget->parent), widget))
1373 + //g_print ("send activate to remote!\n");
1375 + else
1377 + g_signal_emit (widget, menu_item_signals[ACTIVATE_ITEM], 0);
1381 return TRUE;