-
Notifications
You must be signed in to change notification settings - Fork 23
/
072_indicator_menu_update.patch
110 lines (104 loc) · 3.27 KB
/
072_indicator_menu_update.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
## Description: Adding two signals that are needed for Application Indicator to
## keep up-to-date with changed GtkMenu(Item)s.
## Origin/Author: Cody Russell <bratsche@gnome.org>,
## Sense Hofstede <sense@ubuntu.com>
## Bug: unknown and https://launchpad.net/bug/608219
Index: gtk+-2.21.7/gtk/gtkcontainer.c
===================================================================
--- gtk+-2.21.7.orig/gtk/gtkcontainer.c 2010-08-31 01:09:37.000000000 +1000
+++ gtk+-2.21.7/gtk/gtkcontainer.c 2010-09-01 12:22:01.612617000 +1000
@@ -48,6 +48,8 @@
REMOVE,
CHECK_RESIZE,
SET_FOCUS_CHILD,
+ CHILD_ADDED,
+ CHILD_REMOVED,
LAST_SIGNAL
};
@@ -291,6 +293,24 @@
_gtk_marshal_VOID__OBJECT,
G_TYPE_NONE, 1,
GTK_TYPE_WIDGET);
+ container_signals[CHILD_ADDED] =
+ g_signal_new (I_("child-added"),
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ 0,
+ NULL, NULL,
+ _gtk_marshal_VOID__OBJECT,
+ G_TYPE_NONE, 1,
+ GTK_TYPE_WIDGET);
+ container_signals[CHILD_REMOVED] =
+ g_signal_new (I_("child-removed"),
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ 0,
+ NULL, NULL,
+ _gtk_marshal_VOID__OBJECT,
+ G_TYPE_NONE, 1,
+ GTK_TYPE_WIDGET);
}
static void
Index: gtk+-2.21.7/gtk/gtkmenushell.c
===================================================================
--- gtk+-2.21.7.orig/gtk/gtkmenushell.c 2010-09-01 12:21:11.762617001 +1000
+++ gtk+-2.21.7/gtk/gtkmenushell.c 2010-09-01 12:22:01.612617000 +1000
@@ -567,6 +567,8 @@
GTK_WIDGET (menu_shell),
child,
position);
+
+ g_signal_emit_by_name (menu_shell, "child-added", child);
}
static void
Index: gtk+-2.21.7/gtk/gtkmenuitem.c
===================================================================
--- gtk+-2.21.7.orig/gtk/gtkmenuitem.c 2010-09-01 12:21:09.562617001 +1000
+++ gtk+-2.21.7/gtk/gtkmenuitem.c 2010-09-01 12:22:01.612617000 +1000
@@ -52,6 +52,8 @@
ACTIVATE_ITEM,
TOGGLE_SIZE_REQUEST,
TOGGLE_SIZE_ALLOCATE,
+ SUBMENU_ADDED,
+ SUBMENU_REMOVED,
LAST_SIGNAL
};
@@ -244,6 +246,25 @@
G_TYPE_NONE, 1,
G_TYPE_INT);
+ menu_item_signals[SUBMENU_ADDED] =
+ g_signal_new (I_("submenu-added"),
+ G_OBJECT_CLASS_TYPE (gobject_class),
+ G_SIGNAL_RUN_FIRST,
+ 0,
+ NULL, NULL,
+ _gtk_marshal_VOID__OBJECT,
+ G_TYPE_NONE, 1,
+ GTK_TYPE_WIDGET);
+
+ menu_item_signals[SUBMENU_REMOVED] =
+ g_signal_new (I_("submenu-removed"),
+ G_OBJECT_CLASS_TYPE (gobject_class),
+ G_SIGNAL_RUN_FIRST,
+ 0,
+ NULL, NULL,
+ _gtk_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+
/**
* GtkMenuItem:right-justified:
*
@@ -791,6 +812,14 @@
if (GTK_WIDGET (menu_item)->parent)
gtk_widget_queue_resize (GTK_WIDGET (menu_item));
+ if(submenu == NULL)
+ {
+ g_signal_emit_by_name (menu_item, "submenu-removed");
+ }
+ else
+ {
+ g_signal_emit_by_name (menu_item, "submenu-added", GTK_WIDGET(submenu));
+ }
g_object_notify (G_OBJECT (menu_item), "submenu");
}
}