From 7b9c9b2f7dabec457fb0e3f107dc80e24bf1885d Mon Sep 17 00:00:00 2001 From: Cosimo Cecchi Date: Wed, 21 Dec 2011 16:32:18 +0100 Subject: [PATCH] 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 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/shell-app.c b/src/shell-app.c index 332d3f6e3..2fba2f1b3 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));