[gnome-flashback] shell: remove ShowMonitorLabels API



commit ac4e384b960a423a63a49a459ee24a0ae70e1d15
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Fri Apr 12 13:21:29 2019 +0300

    shell: remove ShowMonitorLabels API
    
    GNOME Control Center use ShowMonitorLabels2 API starting with
    3.26 version.

 .../libshell/flashback-monitor-labeler.c           | 100 ---------------------
 .../libshell/flashback-monitor-labeler.h           |   5 --
 gnome-flashback/libshell/flashback-shell.c         |  24 -----
 gnome-flashback/libshell/org.gnome.Shell.xml       |   3 -
 4 files changed, 132 deletions(-)
---
diff --git a/gnome-flashback/libshell/flashback-monitor-labeler.c 
b/gnome-flashback/libshell/flashback-monitor-labeler.c
index b21cf2c..975211f 100644
--- a/gnome-flashback/libshell/flashback-monitor-labeler.c
+++ b/gnome-flashback/libshell/flashback-monitor-labeler.c
@@ -177,106 +177,6 @@ flashback_monitor_labeler_new (void)
   return g_object_new (FLASHBACK_TYPE_MONITOR_LABELER, NULL);
 }
 
-void
-flashback_monitor_labeler_show (FlashbackMonitorLabeler *labeler,
-                                GfMonitorManager        *monitor_manager,
-                                const gchar             *sender,
-                                GVariant                *params)
-{
-  GVariantIter iter;
-  guint id;
-  gint number;
-  GVariant *v;
-  GHashTable *monitors;
-  GList *keys;
-  GList *key;
-  gint i;
-
-  if (labeler->hide_id > 0)
-    {
-      g_source_remove (labeler->hide_id);
-      labeler->hide_id = 0;
-    }
-
-  if (!track_client (labeler, sender))
-    return;
-
-  if (labeler->windows != NULL)
-    return;
-
-  /*if (labeler->windows != NULL)
-    {
-      for (i = 0; i < labeler->n_windows; i++)
-        gtk_widget_destroy (GTK_WIDGET (labeler->windows[i]));
-      g_free (labeler->windows);
-      labeler->windows = NULL;
-    }*/
-
-  g_variant_iter_init (&iter, params);
-
-  monitors = g_hash_table_new (g_direct_hash, g_direct_equal);
-
-  while (g_variant_iter_next (&iter, "{uv}", &id, &v))
-    {
-      gint monitor;
-
-      g_variant_get (v, "i", &number);
-
-      monitor = gf_monitor_manager_get_monitor_for_output (monitor_manager, id);
-
-      if (monitor != -1)
-        {
-          GSList *list;
-          gboolean insert;
-
-          list = (GSList *) g_hash_table_lookup (monitors, GINT_TO_POINTER (monitor));
-          insert = (list == NULL);
-
-          list = g_slist_append (list, GINT_TO_POINTER (number));
-
-          if (insert)
-            g_hash_table_insert (monitors, GINT_TO_POINTER (monitor), list);
-        }
-
-      g_variant_unref (v);
-    }
-
-  keys = g_hash_table_get_keys (monitors);
-
-  labeler->n_windows = g_hash_table_size (monitors);
-  labeler->windows = g_new0 (GfLabelWindow *, labeler->n_windows);
-  i = 0;
-
-  for (key = keys; key; key = key->next)
-    {
-      GSList *labels;
-      GSList *label;
-      GString *string;
-      gchar *real_label;
-
-      labels = (GSList *) g_hash_table_lookup (monitors, key->data);
-      string = g_string_new ("");
-
-      for (label = labels; label; label = label->next)
-        g_string_append_printf (string, "%d ", GPOINTER_TO_INT (label->data));
-      g_string_set_size (string, string->len - 1);
-
-      g_slist_free (labels);
-
-      real_label = g_string_free (string, FALSE);
-      labeler->windows[i] = gf_label_window_new (GPOINTER_TO_INT (key->data),
-                                                 real_label);
-      g_free (real_label);
-
-      gf_label_window_show (labeler->windows[i]);
-
-      i++;
-    }
-
-  g_list_free (keys);
-  g_hash_table_destroy (monitors);
-}
-
 void
 flashback_monitor_labeler_show2 (FlashbackMonitorLabeler *labeler,
                                  GfMonitorManager        *monitor_manager,
diff --git a/gnome-flashback/libshell/flashback-monitor-labeler.h 
b/gnome-flashback/libshell/flashback-monitor-labeler.h
index c7c8fda..c876a76 100644
--- a/gnome-flashback/libshell/flashback-monitor-labeler.h
+++ b/gnome-flashback/libshell/flashback-monitor-labeler.h
@@ -28,11 +28,6 @@ G_DECLARE_FINAL_TYPE (FlashbackMonitorLabeler, flashback_monitor_labeler,
 
 FlashbackMonitorLabeler *flashback_monitor_labeler_new   (void);
 
-void                     flashback_monitor_labeler_show  (FlashbackMonitorLabeler *labeler,
-                                                          GfMonitorManager        *monitor_manager,
-                                                          const gchar             *sender,
-                                                          GVariant                *params);
-
 void                     flashback_monitor_labeler_show2 (FlashbackMonitorLabeler *labeler,
                                                           GfMonitorManager        *monitor_manager,
                                                           const gchar             *sender,
diff --git a/gnome-flashback/libshell/flashback-shell.c b/gnome-flashback/libshell/flashback-shell.c
index ed54e25..8c5966c 100644
--- a/gnome-flashback/libshell/flashback-shell.c
+++ b/gnome-flashback/libshell/flashback-shell.c
@@ -222,28 +222,6 @@ handle_show_osd (FlashbackDBusShell    *dbus_shell,
   return TRUE;
 }
 
-static gboolean
-handle_show_monitor_labels (FlashbackDBusShell    *dbus_shell,
-                            GDBusMethodInvocation *invocation,
-                            GVariant              *params,
-                            gpointer               user_data)
-{
-  FlashbackShell *shell;
-  const gchar *sender;
-
-  shell = FLASHBACK_SHELL (user_data);
-  sender = g_dbus_method_invocation_get_sender (invocation);
-
-  g_assert (shell->monitor_manager != NULL);
-
-  flashback_monitor_labeler_show (shell->labeler, shell->monitor_manager,
-                                  sender, params);
-
-  flashback_dbus_shell_complete_show_monitor_labels (dbus_shell, invocation);
-
-  return TRUE;
-}
-
 static gboolean
 handle_show_monitor_labels2 (FlashbackDBusShell    *dbus_shell,
                              GDBusMethodInvocation *invocation,
@@ -414,8 +392,6 @@ name_appeared_handler (GDBusConnection *connection,
                     G_CALLBACK (handle_focus_search), shell);
   g_signal_connect (skeleton, "handle-show-osd",
                     G_CALLBACK (handle_show_osd), shell);
-  g_signal_connect (skeleton, "handle-show-monitor-labels",
-                    G_CALLBACK (handle_show_monitor_labels), shell);
   g_signal_connect (skeleton, "handle-show-monitor-labels2",
                     G_CALLBACK (handle_show_monitor_labels2), shell);
   g_signal_connect (skeleton, "handle-hide-monitor-labels",
diff --git a/gnome-flashback/libshell/org.gnome.Shell.xml b/gnome-flashback/libshell/org.gnome.Shell.xml
index 78ea866..163c0a9 100644
--- a/gnome-flashback/libshell/org.gnome.Shell.xml
+++ b/gnome-flashback/libshell/org.gnome.Shell.xml
@@ -10,9 +10,6 @@
     <method name="ShowOSD">
       <arg type="a{sv}" direction="in" name="params" />
     </method>
-    <method name="ShowMonitorLabels">
-      <arg type="a{uv}" direction="in" name="params" />
-    </method>
     <method name="ShowMonitorLabels2">
       <arg type="a{sv}" direction="in" name="params" />
     </method>


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