[gnome-shell] shell-app: ensure there's always a muxer when setting actions on it
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] shell-app: ensure there's always a muxer when setting actions on it
- Date: Wed, 21 Dec 2011 15:37:23 +0000 (UTC)
commit 7b9c9b2f7dabec457fb0e3f107dc80e24bf1885d
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Wed Dec 21 16:32:18 2011 +0100
shell-app: ensure there's always a muxer when setting actions on it
It's not guaranteed that the application DBus proxy appears before
we receive the first focus event from the toplevel window.
Ensure that the first method to access the action muxer creates it if
hasn't been created yet.
src/shell-app.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/src/shell-app.c b/src/shell-app.c
index 332d3f6..2fba2f1 100644
--- a/src/shell-app.c
+++ b/src/shell-app.c
@@ -577,6 +577,9 @@ shell_app_update_window_actions (ShellApp *app, MetaWindow *window)
g_object_set_data_full (G_OBJECT (window), "actions", actions, g_object_unref);
}
+ if (!app->running_state->muxer)
+ app->running_state->muxer = g_action_muxer_new ();
+
g_action_muxer_insert (app->running_state->muxer, "win", actions);
g_object_notify (G_OBJECT (app), "action-group");
}
@@ -1092,7 +1095,10 @@ on_dbus_proxy_gotten (GObject *initable,
g_dbus_proxy_get_connection (state->app_proxy),
g_dbus_proxy_get_name (state->app_proxy),
g_dbus_proxy_get_object_path (state->app_proxy));
- state->muxer = g_action_muxer_new ();
+
+ if (!state->muxer)
+ state->muxer = g_action_muxer_new ();
+
g_action_muxer_insert (state->muxer, "app", state->remote_actions);
g_strfreev (g_action_group_list_actions (state->remote_actions));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]