app: Remove :menu property

It is now unused.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/624
This commit is contained in:
Florian Müllner 2018-10-04 19:20:40 +02:00
parent e355756758
commit 753618a19f
3 changed files with 7 additions and 33 deletions

View File

@ -45,7 +45,6 @@ typedef struct {
guint window_sort_stale : 1; guint window_sort_stale : 1;
/* See GApplication documentation */ /* See GApplication documentation */
GDBusMenuModel *remote_menu;
GtkActionMuxer *muxer; GtkActionMuxer *muxer;
char *unique_bus_name; char *unique_bus_name;
GDBusConnection *session; GDBusConnection *session;
@ -92,7 +91,6 @@ enum {
PROP_ID, PROP_ID,
PROP_DBUS_ID, PROP_DBUS_ID,
PROP_ACTION_GROUP, PROP_ACTION_GROUP,
PROP_MENU,
PROP_APP_INFO PROP_APP_INFO
}; };
@ -131,10 +129,6 @@ shell_app_get_property (GObject *gobject,
if (app->running_state) if (app->running_state)
g_value_set_object (value, app->running_state->muxer); g_value_set_object (value, app->running_state->muxer);
break; break;
case PROP_MENU:
if (app->running_state)
g_value_set_object (value, app->running_state->remote_menu);
break;
case PROP_APP_INFO: case PROP_APP_INFO:
if (app->info) if (app->info)
g_value_set_object (value, 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::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); 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); shell_app_ensure_busy_watch (app);
if (!meta_window_is_skip_taskbar (window)) if (!meta_window_is_skip_taskbar (window))
@ -1377,7 +1371,7 @@ create_running_state (ShellApp *app)
} }
void void
shell_app_update_app_menu (ShellApp *app, shell_app_update_app_actions (ShellApp *app,
MetaWindow *window) MetaWindow *window)
{ {
const gchar *unique_bus_name; 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); unique_bus_name = meta_window_get_gtk_unique_bus_name (window);
if (app->running_state->remote_menu == NULL || if (g_strcmp0 (app->running_state->unique_bus_name, unique_bus_name) != 0)
g_strcmp0 (app->running_state->unique_bus_name, unique_bus_name) != 0)
{ {
const gchar *application_object_path; const gchar *application_object_path;
const gchar *app_menu_object_path;
GDBusActionGroup *actions; GDBusActionGroup *actions;
application_object_path = meta_window_get_gtk_application_object_path (window); 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; return;
g_clear_pointer (&app->running_state->unique_bus_name, g_free); g_clear_pointer (&app->running_state->unique_bus_name, g_free);
app->running_state->unique_bus_name = g_strdup (unique_bus_name); 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); 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)); gtk_action_muxer_insert (app->running_state->muxer, "app", G_ACTION_GROUP (actions));
g_object_unref (actions); g_object_unref (actions);
@ -1440,11 +1429,9 @@ unref_running_state (ShellAppRunningState *state)
g_clear_object (&state->cancellable); g_clear_object (&state->cancellable);
} }
g_clear_object (&state->remote_menu);
g_clear_object (&state->muxer); g_clear_object (&state->muxer);
g_clear_object (&state->session); g_clear_object (&state->session);
g_clear_pointer (&state->unique_bus_name, g_free); g_clear_pointer (&state->unique_bus_name, g_free);
g_clear_pointer (&state->remote_menu, g_free);
g_slice_free (ShellAppRunningState, state); g_slice_free (ShellAppRunningState, state);
} }
@ -1572,19 +1559,6 @@ shell_app_class_init(ShellAppClass *klass)
"The action group exported by the remote application", "The action group exported by the remote application",
G_TYPE_ACTION_GROUP, G_TYPE_ACTION_GROUP,
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); 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: * ShellApp:app-info:
* *

View File

@ -67,7 +67,7 @@ int shell_app_compare_by_name (ShellApp *app, ShellApp *other);
int shell_app_compare (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_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); gboolean shell_app_get_busy (ShellApp *app);

View File

@ -474,7 +474,7 @@ update_focus_app (ShellWindowTracker *self)
if (new_focus_app) if (new_focus_app)
{ {
shell_app_update_window_actions (new_focus_app, new_focus_win); 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); set_focus_app (self, new_focus_app);