[gnome-shell/wip/fmuellner/remove-app-menu: 128/130] app: Remove :menu property



commit ce6ab7e121a61e7a46fb64035c9f05eb0e80644f
Author: Florian Müllner <fmuellner gnome org>
Date:   Thu Oct 4 19:20:40 2018 +0200

    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 65a79a301..973fadd6c 100644
--- a/src/shell-app.c
+++ b/src/shell-app.c
@@ -51,7 +51,6 @@ typedef struct {
   guint window_sort_stale : 1;
 
   /* See GApplication documentation */
-  GDBusMenuModel   *remote_menu;
   GtkActionMuxer   *muxer;
   char             *unique_bus_name;
   GDBusConnection  *session;
@@ -98,7 +97,6 @@ enum {
   PROP_ID,
   PROP_DBUS_ID,
   PROP_ACTION_GROUP,
-  PROP_MENU,
   PROP_APP_INFO
 };
 
@@ -137,10 +135,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);
@@ -1081,7 +1075,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))
@@ -1383,8 +1377,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;
 
@@ -1400,23 +1394,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);
@@ -1446,11 +1435,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);
 }
@@ -1578,19 +1565,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 f51bea370..200d3a7d0 100644
--- a/src/shell-window-tracker.c
+++ b/src/shell-window-tracker.c
@@ -478,7 +478,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);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]