From 753618a19f2b293753d3ea48d4089b7864cbbbe5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Thu, 4 Oct 2018 19:20:40 +0200 Subject: [PATCH] app: Remove :menu property It is now unused. https://gitlab.gnome.org/GNOME/gnome-shell/issues/624 --- src/shell-app.c | 36 +++++------------------------------- src/shell-app.h | 2 +- src/shell-window-tracker.c | 2 +- 3 files changed, 7 insertions(+), 33 deletions(-) diff --git a/src/shell-app.c b/src/shell-app.c index c765800dc..5a0f81d52 100644 --- a/src/shell-app.c +++ b/src/shell-app.c @@ -45,7 +45,6 @@ typedef struct { guint window_sort_stale : 1; /* See GApplication documentation */ - GDBusMenuModel *remote_menu; GtkActionMuxer *muxer; char *unique_bus_name; GDBusConnection *session; @@ -92,7 +91,6 @@ enum { PROP_ID, PROP_DBUS_ID, PROP_ACTION_GROUP, - PROP_MENU, PROP_APP_INFO }; @@ -131,10 +129,6 @@ shell_app_get_property (GObject *gobject, if (app->running_state) g_value_set_object (value, app->running_state->muxer); break; - case PROP_MENU: - if (app->running_state) - g_value_set_object (value, app->running_state->remote_menu); - break; case PROP_APP_INFO: if (app->info) g_value_set_object (value, app->info); @@ -1075,7 +1069,7 @@ _shell_app_add_window (ShellApp *app, g_signal_connect (window, "notify::user-time", G_CALLBACK(shell_app_on_user_time_changed), app); g_signal_connect (window, "notify::skip-taskbar", G_CALLBACK(shell_app_on_skip_taskbar_changed), app); - shell_app_update_app_menu (app, window); + shell_app_update_app_actions (app, window); shell_app_ensure_busy_watch (app); if (!meta_window_is_skip_taskbar (window)) @@ -1377,8 +1371,8 @@ create_running_state (ShellApp *app) } void -shell_app_update_app_menu (ShellApp *app, - MetaWindow *window) +shell_app_update_app_actions (ShellApp *app, + MetaWindow *window) { const gchar *unique_bus_name; @@ -1394,23 +1388,18 @@ shell_app_update_app_menu (ShellApp *app, unique_bus_name = meta_window_get_gtk_unique_bus_name (window); - if (app->running_state->remote_menu == NULL || - g_strcmp0 (app->running_state->unique_bus_name, unique_bus_name) != 0) + if (g_strcmp0 (app->running_state->unique_bus_name, unique_bus_name) != 0) { const gchar *application_object_path; - const gchar *app_menu_object_path; GDBusActionGroup *actions; application_object_path = meta_window_get_gtk_application_object_path (window); - app_menu_object_path = meta_window_get_gtk_app_menu_object_path (window); - if (application_object_path == NULL || app_menu_object_path == NULL || unique_bus_name == NULL) + if (application_object_path == NULL || unique_bus_name == NULL) return; g_clear_pointer (&app->running_state->unique_bus_name, g_free); app->running_state->unique_bus_name = g_strdup (unique_bus_name); - g_clear_object (&app->running_state->remote_menu); - app->running_state->remote_menu = g_dbus_menu_model_get (app->running_state->session, unique_bus_name, app_menu_object_path); actions = g_dbus_action_group_get (app->running_state->session, unique_bus_name, application_object_path); gtk_action_muxer_insert (app->running_state->muxer, "app", G_ACTION_GROUP (actions)); g_object_unref (actions); @@ -1440,11 +1429,9 @@ unref_running_state (ShellAppRunningState *state) g_clear_object (&state->cancellable); } - g_clear_object (&state->remote_menu); g_clear_object (&state->muxer); g_clear_object (&state->session); g_clear_pointer (&state->unique_bus_name, g_free); - g_clear_pointer (&state->remote_menu, g_free); g_slice_free (ShellAppRunningState, state); } @@ -1572,19 +1559,6 @@ shell_app_class_init(ShellAppClass *klass) "The action group exported by the remote application", G_TYPE_ACTION_GROUP, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); - /** - * ShellApp:menu: - * - * The #GMenuProxy associated with this ShellApp, if any. See the - * documentation of #GMenuModel for details. - */ - g_object_class_install_property (gobject_class, - PROP_MENU, - g_param_spec_object ("menu", - "Application Menu", - "The primary menu exported by the remote application", - G_TYPE_MENU_MODEL, - G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); /** * ShellApp:app-info: * diff --git a/src/shell-app.h b/src/shell-app.h index f02f53a31..8a09b642d 100644 --- a/src/shell-app.h +++ b/src/shell-app.h @@ -67,7 +67,7 @@ int shell_app_compare_by_name (ShellApp *app, ShellApp *other); int shell_app_compare (ShellApp *app, ShellApp *other); void shell_app_update_window_actions (ShellApp *app, MetaWindow *window); -void shell_app_update_app_menu (ShellApp *app, MetaWindow *window); +void shell_app_update_app_actions (ShellApp *app, MetaWindow *window); gboolean shell_app_get_busy (ShellApp *app); diff --git a/src/shell-window-tracker.c b/src/shell-window-tracker.c index a0ba88450..487bc9b29 100644 --- a/src/shell-window-tracker.c +++ b/src/shell-window-tracker.c @@ -474,7 +474,7 @@ update_focus_app (ShellWindowTracker *self) if (new_focus_app) { shell_app_update_window_actions (new_focus_app, new_focus_win); - shell_app_update_app_menu (new_focus_app, new_focus_win); + shell_app_update_app_actions (new_focus_app, new_focus_win); } set_focus_app (self, new_focus_app);