[gnome-terminal] window: Remove icon title handling



commit 887c8128d7c528660afa53fad9ae46e72ca7297c
Author: Christian Persch <chpe src gnome org>
Date:   Wed May 2 19:32:52 2018 +0200

    window: Remove icon title handling

 src/terminal-screen.c |   49 ------------------------------
 src/terminal-screen.h |    2 -
 src/terminal-window.c |   78 -------------------------------------------------
 3 files changed, 0 insertions(+), 129 deletions(-)
---
diff --git a/src/terminal-screen.c b/src/terminal-screen.c
index f67f8a2..ed939b2 100644
--- a/src/terminal-screen.c
+++ b/src/terminal-screen.c
@@ -108,8 +108,6 @@ enum
 enum {
   PROP_0,
   PROP_PROFILE,
-  PROP_ICON_TITLE,
-  PROP_ICON_TITLE_SET,
   PROP_TITLE,
   PROP_INITIAL_ENVIRONMENT
 };
@@ -149,8 +147,6 @@ static void terminal_screen_child_exited  (VteTerminal *terminal,
 
 static void terminal_screen_window_title_changed      (VteTerminal *vte_terminal,
                                                        TerminalScreen *screen);
-static void terminal_screen_icon_title_changed        (VteTerminal *vte_terminal,
-                                                       TerminalScreen *screen);
 
 static void update_color_scheme                      (TerminalScreen *screen);
 
@@ -397,9 +393,6 @@ terminal_screen_init (TerminalScreen *screen)
   g_signal_connect (screen, "window-title-changed",
                     G_CALLBACK (terminal_screen_window_title_changed),
                     screen);
-  g_signal_connect (screen, "icon-title-changed",
-                    G_CALLBACK (terminal_screen_icon_title_changed),
-                    screen);
 
   app = terminal_app_get ();
   g_signal_connect (terminal_app_get_desktop_interface_settings (app), "changed::" MONOSPACE_FONT_KEY_NAME,
@@ -427,12 +420,6 @@ terminal_screen_get_property (GObject *object,
       case PROP_PROFILE:
         g_value_set_object (value, terminal_screen_get_profile (screen));
         break;
-      case PROP_ICON_TITLE:
-        g_value_set_string (value, terminal_screen_get_icon_title (screen));
-        break;
-      case PROP_ICON_TITLE_SET:
-        g_value_set_boolean (value, terminal_screen_get_icon_title_set (screen));
-        break;
       case PROP_INITIAL_ENVIRONMENT:
         g_value_set_boxed (value, terminal_screen_get_initial_environment (screen));
         break;
@@ -461,8 +448,6 @@ terminal_screen_set_property (GObject *object,
       case PROP_INITIAL_ENVIRONMENT:
         terminal_screen_set_initial_environment (screen, g_value_get_boxed (value));
         break;
-      case PROP_ICON_TITLE:
-      case PROP_ICON_TITLE_SET:
       case PROP_TITLE:
         /* not writable */
       default:
@@ -543,20 +528,6 @@ terminal_screen_class_init (TerminalScreenClass *klass)
 
   g_object_class_install_property
     (object_class,
-     PROP_ICON_TITLE,
-     g_param_spec_string ("icon-title", NULL, NULL,
-                          NULL,
-                          G_PARAM_READABLE | G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | 
G_PARAM_STATIC_BLURB));
-
-  g_object_class_install_property
-    (object_class,
-     PROP_ICON_TITLE_SET,
-     g_param_spec_boolean ("icon-title-set", NULL, NULL,
-                           FALSE,
-                           G_PARAM_READABLE | G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | 
G_PARAM_STATIC_BLURB));
-
-  g_object_class_install_property
-    (object_class,
      PROP_TITLE,
      g_param_spec_string ("title", NULL, NULL,
                           NULL,
@@ -762,18 +733,6 @@ terminal_screen_get_title (TerminalScreen *screen)
   return vte_terminal_get_window_title (VTE_TERMINAL (screen));
 }
 
-const char*
-terminal_screen_get_icon_title (TerminalScreen *screen)
-{
-  return vte_terminal_get_icon_title (VTE_TERMINAL (screen));
-}
-
-gboolean
-terminal_screen_get_icon_title_set (TerminalScreen *screen)
-{
-  return vte_terminal_get_icon_title (VTE_TERMINAL (screen)) != NULL;
-}
-
 static void
 terminal_screen_profile_changed_cb (GSettings     *profile,
                                     const char    *prop_name,
@@ -1677,14 +1636,6 @@ terminal_screen_window_title_changed (VteTerminal *vte_terminal,
 }
 
 static void
-terminal_screen_icon_title_changed (VteTerminal *vte_terminal,
-                                    TerminalScreen *screen)
-{
-  g_object_notify (G_OBJECT (screen), "icon-title");
-  g_object_notify (G_OBJECT (screen), "icon-title-set");
-}
-
-static void
 terminal_screen_child_exited (VteTerminal *terminal,
                               int status)
 {
diff --git a/src/terminal-screen.h b/src/terminal-screen.h
index 743071d..ff77fcf 100644
--- a/src/terminal-screen.h
+++ b/src/terminal-screen.h
@@ -104,8 +104,6 @@ void         terminal_screen_set_initial_environment (TerminalScreen  *screen,
 char **      terminal_screen_get_initial_environment (TerminalScreen  *screen);
 
 const char* terminal_screen_get_title          (TerminalScreen *screen);
-const char* terminal_screen_get_icon_title     (TerminalScreen *screen);
-gboolean    terminal_screen_get_icon_title_set (TerminalScreen *screen);
 
 char *terminal_screen_get_current_dir (TerminalScreen *screen);
 
diff --git a/src/terminal-window.c b/src/terminal-window.c
index a348a80..91fa09d 100644
--- a/src/terminal-window.c
+++ b/src/terminal-window.c
@@ -90,9 +90,6 @@ struct _TerminalWindowPrivate
   guint present_on_insert : 1;
 
   guint realized : 1;
-
-  /* Workaround until gtk+ bug #535557 is fixed */
-  guint icon_title_set : 1;
 };
 
 #define TERMINAL_WINDOW_CSS_NAME "terminal-window"
@@ -167,11 +164,6 @@ static void terminal_window_show (GtkWidget *widget);
 static gboolean confirm_close_window_or_tab (TerminalWindow *window,
                                              TerminalScreen *screen);
 
-static void
-sync_screen_icon_title (TerminalScreen *screen,
-                        GParamSpec *psepc,
-                        TerminalWindow *window);
-
 G_DEFINE_TYPE (TerminalWindow, terminal_window, GTK_TYPE_APPLICATION_WINDOW)
 
 /* Zoom helpers */
@@ -1945,10 +1937,6 @@ terminal_window_realize (GtkWidget *widget)
 
   GTK_WIDGET_CLASS (terminal_window_parent_class)->realize (widget);
 
-  /* Need to do this now since this requires the window to be realized */
-  if (priv->active_screen != NULL)
-    sync_screen_icon_title (priv->active_screen, NULL, window);
-
   /* Now that we've been realized, we should know precisely how large the
    * client-side decorations are going to be. Recalculate the geometry hints,
    * export them to the windowing system, and resize the window accordingly. */
@@ -2423,58 +2411,6 @@ sync_screen_title (TerminalScreen *screen,
 }
 
 static void
-sync_screen_icon_title (TerminalScreen *screen,
-                        GParamSpec *psepc,
-                        TerminalWindow *window)
-{
-  TerminalWindowPrivate *priv = window->priv;
-
-  if (!gtk_widget_get_realized (GTK_WIDGET (window)))
-    return;
-
-  if (screen != priv->active_screen)
-    return;
-
-  if (!terminal_screen_get_icon_title_set (screen))
-    return;
-
-  gdk_window_set_icon_name (gtk_widget_get_window (GTK_WIDGET (window)), terminal_screen_get_icon_title 
(screen));
-
-  priv->icon_title_set = TRUE;
-}
-
-static void
-sync_screen_icon_title_set (TerminalScreen *screen,
-                            GParamSpec *psepc,
-                            TerminalWindow *window)
-{
-  TerminalWindowPrivate *priv = window->priv;
-
-  if (!gtk_widget_get_realized (GTK_WIDGET (window)))
-    return;
-
-  /* No need to restore the title if we never set an icon title */
-  if (!priv->icon_title_set)
-    return;
-
-  if (screen != priv->active_screen)
-    return;
-
-  if (terminal_screen_get_icon_title_set (screen))
-    return;
-
-  /* Need to reset the icon name */
-  /* FIXME: Once gtk+ bug 535557 is fixed, use that to unset the icon title. */
-
-  g_object_set_qdata (G_OBJECT (gtk_widget_get_window (GTK_WIDGET (window))),
-                      g_quark_from_static_string ("gdk-icon-name-set"),
-                      GUINT_TO_POINTER (FALSE));
-  priv->icon_title_set = FALSE;
-
-  /* Re-setting the right title will be done by the notify::title handler which comes after this one */
-}
-
-static void
 screen_font_any_changed_cb (TerminalScreen *screen,
                             GParamSpec *psepc,
                             TerminalWindow *window)
@@ -2808,8 +2744,6 @@ mdi_screen_switched_cb (TerminalMdiContainer *container,
       terminal_window_set_menubar_visible (window, setting);
     }
 
-  sync_screen_icon_title_set (screen, NULL, window);
-  sync_screen_icon_title (screen, NULL, window);
   sync_screen_title (screen, NULL, window);
 
   /* set size of window to current grid size */
@@ -2847,10 +2781,6 @@ mdi_screen_added_cb (TerminalMdiContainer *container,
   /* FIXME: only connect on the active screen, not all screens! */
   g_signal_connect (screen, "notify::title",
                     G_CALLBACK (sync_screen_title), window);
-  g_signal_connect (screen, "notify::icon-title",
-                    G_CALLBACK (sync_screen_icon_title), window);
-  g_signal_connect (screen, "notify::icon-title-set",
-                    G_CALLBACK (sync_screen_icon_title_set), window);
   g_signal_connect (screen, "notify::font-desc",
                     G_CALLBACK (screen_font_any_changed_cb), window);
   g_signal_connect (screen, "notify::font-scale",
@@ -2933,14 +2863,6 @@ mdi_screen_removed_cb (TerminalMdiContainer *container,
                                         window);
 
   g_signal_handlers_disconnect_by_func (G_OBJECT (screen),
-                                        G_CALLBACK (sync_screen_icon_title),
-                                        window);
-
-  g_signal_handlers_disconnect_by_func (G_OBJECT (screen),
-                                        G_CALLBACK (sync_screen_icon_title_set),
-                                        window);
-
-  g_signal_handlers_disconnect_by_func (G_OBJECT (screen),
                                         G_CALLBACK (screen_font_any_changed_cb),
                                         window);
 


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