[gnome-terminal] screen: Update colors at the right spot



commit de938fe51eeb99433b584ee14d27a4d0dd594dbe
Author: Benjamin Otte <otte redhat com>
Date:   Fri Mar 20 12:37:32 2015 +0100

    screen: Update colors at the right spot
    
    The window is not the right place to listen for style changes on the
    TerminalScreen widget.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=746425

 src/terminal-screen.c |   13 ++++++++++++-
 src/terminal-screen.h |    2 --
 src/terminal-window.c |    4 ----
 3 files changed, 12 insertions(+), 7 deletions(-)
---
diff --git a/src/terminal-screen.c b/src/terminal-screen.c
index df3fdde..1cccea3 100644
--- a/src/terminal-screen.c
+++ b/src/terminal-screen.c
@@ -255,13 +255,23 @@ terminal_screen_realize (GtkWidget *widget)
   terminal_screen_set_font (screen);
 }
 
-void
+static void
 terminal_screen_update_style (TerminalScreen *screen)
 {
   update_color_scheme (screen);
   terminal_screen_set_font (screen);
 }
 
+static void
+terminal_screen_style_updated (GtkWidget *widget)
+{
+  TerminalScreen *screen = TERMINAL_SCREEN (widget);
+
+  GTK_WIDGET_CLASS (terminal_screen_parent_class)->style_updated (widget);
+
+  terminal_screen_update_style (screen);
+}
+
 #ifdef ENABLE_DEBUG
 static void
 size_request (GtkWidget *widget,
@@ -435,6 +445,7 @@ terminal_screen_class_init (TerminalScreenClass *klass)
   object_class->set_property = terminal_screen_set_property;
 
   widget_class->realize = terminal_screen_realize;
+  widget_class->style_updated = terminal_screen_style_updated;
   widget_class->drag_data_received = terminal_screen_drag_data_received;
   widget_class->button_press_event = terminal_screen_button_press;
   widget_class->popup_menu = terminal_screen_popup_menu;
diff --git a/src/terminal-screen.h b/src/terminal-screen.h
index 96f0a0d..a168e57 100644
--- a/src/terminal-screen.h
+++ b/src/terminal-screen.h
@@ -119,8 +119,6 @@ void terminal_screen_save_config (TerminalScreen *screen,
                                   GKeyFile *key_file,
                                   const char *group);
 
-void terminal_screen_update_style (TerminalScreen *screen);
-
 gboolean terminal_screen_has_foreground_process (TerminalScreen *screen,
                                                  char           **process_name,
                                                  char           **cmdline);
diff --git a/src/terminal-window.c b/src/terminal-window.c
index 12cae4f..bb153b2 100644
--- a/src/terminal-window.c
+++ b/src/terminal-window.c
@@ -2725,13 +2725,9 @@ static void
 terminal_window_style_updated (GtkWidget *widget)
 {
   TerminalWindow *window = TERMINAL_WINDOW (widget);
-  TerminalWindowPrivate *priv = window->priv;
 
   GTK_WIDGET_CLASS (terminal_window_parent_class)->style_updated (widget);
 
-  if (priv->active_screen != NULL)
-    terminal_screen_update_style (priv->active_screen);
-
   terminal_window_update_size (window);
 }
 


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