Merge lp:~indicator-applet-developers/indicator-appmenu/ubuntu into lp:~ubuntu-desktop/indicator-appmenu/ubuntu

Proposed by Ted Gould
Status: Merged
Merged at revision: 51
Proposed branch: lp:~indicator-applet-developers/indicator-appmenu/ubuntu
Merge into: lp:~ubuntu-desktop/indicator-appmenu/ubuntu
Diff against target: 393 lines (+115/-34)
7 files modified
ChangeLog (+24/-0)
configure (+10/-10)
configure.ac (+2/-2)
debian/changelog (+8/-0)
src/indicator-appmenu.c (+37/-0)
src/window-menus.c (+30/-22)
src/window-menus.h (+4/-0)
To merge this branch: bzr merge lp:~indicator-applet-developers/indicator-appmenu/ubuntu
Reviewer Review Type Date Requested Status
Ken VanDine Pending
Review via email: mp+52922@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ChangeLog'
2--- ChangeLog 2011-02-17 20:24:29 +0000
3+++ ChangeLog 2011-03-10 20:37:28 +0000
4@@ -1,5 +1,29 @@
5 # Generated by Makefile. Do not edit.
6
7+2011-03-10 Ted Gould <ted@gould.cx>
8+
9+ 0.1.96
10+
11+2011-03-09 Ted Gould <ted@gould.cx>
12+
13+ Watch for the status change from the window and pass that up through libindicator
14+
15+2011-03-09 Michael Terry <mike@mterry.name>
16+
17+ notify about new entries' statuses after adding new entries, not before
18+
19+2011-03-08 Michael Terry <mike@mterry.name>
20+
21+ emit show-now-changed signals when they are propogated to us
22+
23+2011-03-02 Ted Gould <ted@gould.cx>
24+
25+ Fix to match DBus API changes
26+
27+2011-02-28 Ted Gould <ted@gould.cx>
28+
29+ Switch from client send event to menuitem send event on the root node without being specific about the event in question.
30+
31 2011-02-17 Ted Gould <ted@gould.cx>
32
33 0.1.95
34
35=== modified file 'configure'
36--- configure 2011-02-17 20:25:07 +0000
37+++ configure 2011-03-10 20:37:28 +0000
38@@ -1,6 +1,6 @@
39 #! /bin/sh
40 # Guess values for system-dependent variables and create Makefiles.
41-# Generated by GNU Autoconf 2.67 for indicator-appmenu 0.1.95.
42+# Generated by GNU Autoconf 2.67 for indicator-appmenu 0.1.96.
43 #
44 # Report bugs to <ted@canonical.com>.
45 #
46@@ -703,8 +703,8 @@
47 # Identity of this package.
48 PACKAGE_NAME='indicator-appmenu'
49 PACKAGE_TARNAME='indicator-appmenu'
50-PACKAGE_VERSION='0.1.95'
51-PACKAGE_STRING='indicator-appmenu 0.1.95'
52+PACKAGE_VERSION='0.1.96'
53+PACKAGE_STRING='indicator-appmenu 0.1.96'
54 PACKAGE_BUGREPORT='ted@canonical.com'
55 PACKAGE_URL=''
56
57@@ -1462,7 +1462,7 @@
58 # Omit some internal or obsolete options to make the list less imposing.
59 # This message is too long to be a string in the A/UX 3.1 sh.
60 cat <<_ACEOF
61-\`configure' configures indicator-appmenu 0.1.95 to adapt to many kinds of systems.
62+\`configure' configures indicator-appmenu 0.1.96 to adapt to many kinds of systems.
63
64 Usage: $0 [OPTION]... [VAR=VALUE]...
65
66@@ -1533,7 +1533,7 @@
67
68 if test -n "$ac_init_help"; then
69 case $ac_init_help in
70- short | recursive ) echo "Configuration of indicator-appmenu 0.1.95:";;
71+ short | recursive ) echo "Configuration of indicator-appmenu 0.1.96:";;
72 esac
73 cat <<\_ACEOF
74
75@@ -1656,7 +1656,7 @@
76 test -n "$ac_init_help" && exit $ac_status
77 if $ac_init_version; then
78 cat <<\_ACEOF
79-indicator-appmenu configure 0.1.95
80+indicator-appmenu configure 0.1.96
81 generated by GNU Autoconf 2.67
82
83 Copyright (C) 2010 Free Software Foundation, Inc.
84@@ -1936,7 +1936,7 @@
85 This file contains any messages produced by compilers while
86 running configure, to aid debugging if configure makes a mistake.
87
88-It was created by indicator-appmenu $as_me 0.1.95, which was
89+It was created by indicator-appmenu $as_me 0.1.96, which was
90 generated by GNU Autoconf 2.67. Invocation command line was
91
92 $ $0 $@
93@@ -2757,7 +2757,7 @@
94
95 # Define the identity of the package.
96 PACKAGE=indicator-appmenu
97- VERSION=0.1.95
98+ VERSION=0.1.96
99
100
101 cat >>confdefs.h <<_ACEOF
102@@ -12623,7 +12623,7 @@
103 # report actual input values of CONFIG_FILES etc. instead of their
104 # values after options handling.
105 ac_log="
106-This file was extended by indicator-appmenu $as_me 0.1.95, which was
107+This file was extended by indicator-appmenu $as_me 0.1.96, which was
108 generated by GNU Autoconf 2.67. Invocation command line was
109
110 CONFIG_FILES = $CONFIG_FILES
111@@ -12689,7 +12689,7 @@
112 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
113 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
114 ac_cs_version="\\
115-indicator-appmenu config.status 0.1.95
116+indicator-appmenu config.status 0.1.96
117 configured by $0, generated by GNU Autoconf 2.67,
118 with options \\"\$ac_cs_config\\"
119
120
121=== modified file 'configure.ac'
122--- configure.ac 2011-02-17 20:25:07 +0000
123+++ configure.ac 2011-03-10 20:37:28 +0000
124@@ -1,11 +1,11 @@
125
126-AC_INIT(indicator-appmenu, 0.1.95, ted@canonical.com)
127+AC_INIT(indicator-appmenu, 0.1.96, ted@canonical.com)
128 AC_COPYRIGHT([Copyright 2010 Canonical])
129
130 AC_PREREQ(2.53)
131
132 AM_CONFIG_HEADER(config.h)
133-AM_INIT_AUTOMAKE(indicator-appmenu, 0.1.95)
134+AM_INIT_AUTOMAKE(indicator-appmenu, 0.1.96)
135
136 AM_MAINTAINER_MODE
137
138
139=== modified file 'debian/changelog'
140--- debian/changelog 2011-02-17 21:06:18 +0000
141+++ debian/changelog 2011-03-10 20:37:28 +0000
142@@ -1,3 +1,11 @@
143+indicator-appmenu (0.1.96-0ubuntu1~ppa1) natty; urgency=low
144+
145+ * New upstream release.
146+ ∘ Fix to match DBusmenu API changes
147+ ∘ Pass signal through libindicator to show menu items on Alt
148+
149+ -- Ted Gould <ted@ubuntu.com> Thu, 10 Mar 2011 14:30:06 -0600
150+
151 indicator-appmenu (0.1.95-0ubuntu1) natty; urgency=low
152
153 * New upstream release.
154
155=== modified file 'src/indicator-appmenu.c'
156--- src/indicator-appmenu.c 2011-02-17 20:25:07 +0000
157+++ src/indicator-appmenu.c 2011-03-10 20:37:28 +0000
158@@ -90,6 +90,7 @@
159
160 gulong sig_entry_added;
161 gulong sig_entry_removed;
162+ gulong sig_status_changed;
163 gulong sig_show_menu;
164 gulong sig_a11y_update;
165
166@@ -166,6 +167,9 @@
167 static void window_entry_removed (WindowMenus * mw,
168 IndicatorObjectEntry * entry,
169 gpointer user_data);
170+static void window_status_changed (WindowMenus * mw,
171+ DbusmenuStatus status,
172+ IndicatorAppmenu * iapp);
173 static void window_show_menu (WindowMenus * mw,
174 IndicatorObjectEntry * entry,
175 guint timestamp,
176@@ -1088,6 +1092,10 @@
177 g_signal_handler_disconnect(G_OBJECT(iapp->default_app), iapp->sig_entry_removed);
178 iapp->sig_entry_removed = 0;
179 }
180+ if (iapp->sig_status_changed != 0) {
181+ g_signal_handler_disconnect(G_OBJECT(iapp->default_app), iapp->sig_status_changed);
182+ iapp->sig_status_changed = 0;
183+ }
184 if (iapp->sig_show_menu != 0) {
185 g_signal_handler_disconnect(G_OBJECT(iapp->default_app), iapp->sig_show_menu);
186 iapp->sig_show_menu = 0;
187@@ -1117,6 +1125,10 @@
188 WINDOW_MENUS_SIGNAL_ENTRY_REMOVED,
189 G_CALLBACK(window_entry_removed),
190 iapp);
191+ iapp->sig_status_changed = g_signal_connect(G_OBJECT(iapp->default_app),
192+ WINDOW_MENUS_SIGNAL_STATUS_CHANGED,
193+ G_CALLBACK(window_status_changed),
194+ iapp);
195 iapp->sig_show_menu = g_signal_connect(G_OBJECT(iapp->default_app),
196 WINDOW_MENUS_SIGNAL_SHOW_MENU,
197 G_CALLBACK(window_show_menu),
198@@ -1154,6 +1166,14 @@
199
200 g_list_free(entry_head);
201
202+ /* Set up initial state for new entries if needed */
203+ if (iapp->default_app != NULL &&
204+ window_menus_get_status (iapp->default_app) != DBUSMENU_STATUS_NORMAL) {
205+ window_status_changed (iapp->default_app,
206+ window_menus_get_status (iapp->default_app),
207+ iapp);
208+ }
209+
210 return;
211 }
212
213@@ -1394,6 +1414,23 @@
214 return;
215 }
216
217+/* Pass up the status changed event */
218+static void
219+window_status_changed (WindowMenus * mw, DbusmenuStatus status, IndicatorAppmenu * iapp)
220+{
221+ gboolean show_now = (status == DBUSMENU_STATUS_NOTICE);
222+ GList * entry_head, * entries;
223+
224+ entry_head = indicator_object_get_entries(INDICATOR_OBJECT(iapp));
225+
226+ for (entries = entry_head; entries != NULL; entries = g_list_next(entries)) {
227+ IndicatorObjectEntry * entry = (IndicatorObjectEntry *)entries->data;
228+ g_signal_emit(G_OBJECT(iapp), INDICATOR_OBJECT_SIGNAL_SHOW_NOW_CHANGED_ID, 0, entry, show_now);
229+ }
230+
231+ return;
232+}
233+
234 /* Pass up the show menu event */
235 static void
236 window_show_menu (WindowMenus * mw, IndicatorObjectEntry * entry, guint timestamp, gpointer user_data)
237
238=== modified file 'src/window-menus.c'
239--- src/window-menus.c 2011-02-17 20:25:07 +0000
240+++ src/window-menus.c 2011-03-10 20:37:28 +0000
241@@ -42,10 +42,6 @@
242 GArray * entries;
243 gboolean error_state;
244 guint retry_timer;
245- gint retry_id;
246- gchar * retry_name;
247- GVariant * retry_data;
248- guint retry_timestamp;
249 };
250
251 typedef struct _WMEntry WMEntry;
252@@ -66,6 +62,7 @@
253 ENTRY_ADDED,
254 ENTRY_REMOVED,
255 ERROR_STATE,
256+ STATUS_CHANGED,
257 SHOW_MENU,
258 A11Y_UPDATE,
259 LAST_SIGNAL
260@@ -120,6 +117,13 @@
261 NULL, NULL,
262 g_cclosure_marshal_VOID__BOOLEAN,
263 G_TYPE_NONE, 1, G_TYPE_BOOLEAN, G_TYPE_NONE);
264+ signals[STATUS_CHANGED] = g_signal_new(WINDOW_MENUS_SIGNAL_STATUS_CHANGED,
265+ G_TYPE_FROM_CLASS(klass),
266+ G_SIGNAL_RUN_LAST,
267+ G_STRUCT_OFFSET (WindowMenusClass, status_changed),
268+ NULL, NULL,
269+ g_cclosure_marshal_VOID__INT,
270+ G_TYPE_NONE, 1, G_TYPE_INT, G_TYPE_NONE);
271 signals[SHOW_MENU] = g_signal_new(WINDOW_MENUS_SIGNAL_SHOW_MENU,
272 G_TYPE_FROM_CLASS(klass),
273 G_SIGNAL_RUN_LAST,
274@@ -245,10 +249,6 @@
275 if (priv->retry_timer != 0) {
276 g_source_remove(priv->retry_timer);
277 priv->retry_timer = 0;
278- g_variant_unref(priv->retry_data);
279- priv->retry_data = NULL;
280- g_free(priv->retry_name);
281- priv->retry_name = NULL;
282 }
283
284 G_OBJECT_CLASS (window_menus_parent_class)->dispose (object);
285@@ -264,13 +264,12 @@
286 g_return_val_if_fail(IS_WINDOW_MENUS(user_data), FALSE);
287 WindowMenusPrivate * priv = WINDOW_MENUS_GET_PRIVATE(user_data);
288
289- dbusmenu_client_send_event(DBUSMENU_CLIENT(priv->client), priv->retry_id, priv->retry_name, priv->retry_data, priv->retry_timestamp);
290+ dbusmenu_menuitem_handle_event(dbusmenu_client_get_root(DBUSMENU_CLIENT(priv->client)),
291+ "x-appmenu-retry-ping",
292+ NULL,
293+ 0);
294
295 priv->retry_timer = 0;
296- g_variant_unref(priv->retry_data);
297- priv->retry_data = NULL;
298- g_free(priv->retry_name);
299- priv->retry_name = NULL;
300
301 return FALSE;
302 }
303@@ -303,10 +302,6 @@
304 if (priv->retry_timer != 0) {
305 g_source_remove(priv->retry_timer);
306 priv->retry_timer = 0;
307- g_variant_unref(priv->retry_data);
308- priv->retry_data = NULL;
309- g_free(priv->retry_name);
310- priv->retry_name = NULL;
311 }
312
313 return;
314@@ -331,11 +326,6 @@
315 if (priv->retry_timer == 0) {
316 g_debug("Setting up retry timer");
317 priv->retry_timer = g_timeout_add_seconds(1, retry_event, user_data);
318-
319- priv->retry_id = dbusmenu_menuitem_get_id(mi);
320- priv->retry_name = g_strdup(event);
321- priv->retry_data = g_variant_ref(evdata);
322- priv->retry_timestamp = timestamp;
323 }
324
325 return;
326@@ -384,6 +374,23 @@
327 return;
328 }
329
330+/* Called when the client changes its status. Used to show panel if requested.
331+ (Say, by an Alt press.) */
332+static void
333+status_changed (DbusmenuClient * client, GParamSpec * pspec, gpointer user_data)
334+{
335+ g_signal_emit(G_OBJECT(user_data), signals[STATUS_CHANGED], 0, dbusmenu_client_get_status (client));
336+}
337+
338+DbusmenuStatus
339+window_menus_get_status (WindowMenus * wm)
340+{
341+ g_return_val_if_fail(IS_WINDOW_MENUS(wm), DBUSMENU_STATUS_NORMAL);
342+ WindowMenusPrivate * priv = WINDOW_MENUS_GET_PRIVATE(wm);
343+
344+ return dbusmenu_client_get_status (DBUSMENU_CLIENT (priv->client));
345+}
346+
347 /* Build a new window menus object and attach to the signals to build
348 up the representative menu. */
349 WindowMenus *
350@@ -420,6 +427,7 @@
351 g_signal_connect(G_OBJECT(priv->client), DBUSMENU_GTKCLIENT_SIGNAL_ROOT_CHANGED, G_CALLBACK(root_changed), newmenu);
352 g_signal_connect(G_OBJECT(priv->client), DBUSMENU_CLIENT_SIGNAL_EVENT_RESULT, G_CALLBACK(event_status), newmenu);
353 g_signal_connect(G_OBJECT(priv->client), DBUSMENU_CLIENT_SIGNAL_ITEM_ACTIVATE, G_CALLBACK(item_activate), newmenu);
354+ g_signal_connect(G_OBJECT(priv->client), "notify::" DBUSMENU_CLIENT_PROP_STATUS, G_CALLBACK(status_changed), newmenu);
355
356 DbusmenuMenuitem * root = dbusmenu_client_get_root(DBUSMENU_CLIENT(priv->client));
357 if (root != NULL) {
358
359=== modified file 'src/window-menus.h'
360--- src/window-menus.h 2011-02-17 19:45:57 +0000
361+++ src/window-menus.h 2011-03-10 20:37:28 +0000
362@@ -25,6 +25,7 @@
363 #include <glib.h>
364 #include <glib-object.h>
365 #include <libindicator/indicator-object.h>
366+#include <libdbusmenu-glib/client.h>
367
368 G_BEGIN_DECLS
369
370@@ -38,6 +39,7 @@
371 #define WINDOW_MENUS_SIGNAL_ENTRY_ADDED "entry-added"
372 #define WINDOW_MENUS_SIGNAL_ENTRY_REMOVED "entry-removed"
373 #define WINDOW_MENUS_SIGNAL_ERROR_STATE "error-state"
374+#define WINDOW_MENUS_SIGNAL_STATUS_CHANGED "status-changed"
375 #define WINDOW_MENUS_SIGNAL_SHOW_MENU "show-menu"
376 #define WINDOW_MENUS_SIGNAL_A11Y_UPDATE "a11y-update"
377
378@@ -52,6 +54,7 @@
379 void (*entry_removed) (WindowMenus * wm, IndicatorObjectEntry * entry, gpointer user_data);
380
381 void (*error_state) (WindowMenus * wm, gboolean state, gpointer user_data);
382+ void (*status_changed) (WindowMenus * wm, DbusmenuStatus status, gpointer user_data);
383
384 void (*show_menu) (WindowMenus * wm, IndicatorObjectEntry * entry, guint timestamp, gpointer user_data);
385 void (*a11y_update) (WindowMenus * wm, IndicatorObjectEntry * entry, gpointer user_data);
386@@ -71,6 +74,7 @@
387 gchar * window_menus_get_address (WindowMenus * wm);
388
389 gboolean window_menus_get_error_state (WindowMenus * wm);
390+DbusmenuStatus window_menus_get_status (WindowMenus * wm);
391 void window_menus_entry_restore (WindowMenus * wm, IndicatorObjectEntry * entry);
392
393 void window_menus_entry_activate (WindowMenus * wm, IndicatorObjectEntry * entry, guint timestamp);

Subscribers

People subscribed via source and target branches

to all changes: