diff options
author | Ted Gould <ted@gould.cx> | 2010-02-25 10:21:19 -0600 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2010-02-25 10:21:19 -0600 |
commit | 99cc36a40cfe6694e119b3f5e9292f5bca931dd0 (patch) | |
tree | 69571ad6b22d2d0c67ae501432ec0edbf8ebefe0 /tests/test-glib-proxy-server.c | |
parent | 2fbb0fde5d48b456821e97394017aa6b85302bcd (diff) | |
parent | 70dbdabe93be35352fb29f8d63f52d710d8544e3 (diff) | |
download | libdbusmenu-99cc36a40cfe6694e119b3f5e9292f5bca931dd0.tar.gz libdbusmenu-99cc36a40cfe6694e119b3f5e9292f5bca931dd0.tar.bz2 libdbusmenu-99cc36a40cfe6694e119b3f5e9292f5bca931dd0.zip |
* Upstream release 0.2.6
* Fix testing to make it more reliable
* Remove delayed property queueing as it was causing
properties to not get updated.
Diffstat (limited to 'tests/test-glib-proxy-server.c')
-rw-r--r-- | tests/test-glib-proxy-server.c | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/tests/test-glib-proxy-server.c b/tests/test-glib-proxy-server.c index cba8ec7..f32b426 100644 --- a/tests/test-glib-proxy-server.c +++ b/tests/test-glib-proxy-server.c @@ -69,22 +69,39 @@ layout2menuitem (proplayout_t * layout) static guint layouton = 0; static DbusmenuServer * server = NULL; static GMainLoop * mainloop = NULL; +static guint death_timer = 0; static gboolean timer_func (gpointer data) { + g_debug("Death timer. Oops. Got to: %d", layouton); + g_main_loop_quit(mainloop); + return FALSE; +} + +static void +layout_change (DbusmenuMenuitem * oldroot, guint timestamp, gpointer data) +{ if (layouts[layouton].id == -1) { g_main_loop_quit(mainloop); - return FALSE; + return; } g_debug("Updating to Layout %d", layouton); DbusmenuMenuitem * mi = layout2menuitem(&layouts[layouton]); + g_signal_connect(G_OBJECT(mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(layout_change), NULL); + dbusmenu_menuitem_property_set_int(mi, LAYOUT_ON, layouton); dbusmenu_server_set_root(server, mi); g_object_unref(G_OBJECT(mi)); layouton++; - return TRUE; + /* Extend our death */ + if (death_timer != 0) { + g_source_remove(death_timer); + } + death_timer = g_timeout_add_seconds(4, timer_func, data); + + return; } int @@ -111,9 +128,7 @@ main (int argc, char ** argv) } server = dbusmenu_server_new("/org/test"); - - timer_func(NULL); - g_timeout_add(2500, timer_func, NULL); + layout_change(NULL, 0, NULL); mainloop = g_main_loop_new(NULL, FALSE); g_main_loop_run(mainloop); |