tags 683744 + patch
thanks

On Thu, 05 Dec 2013 at 12:42:25 +0000, Simon McVittie wrote:
> On 05/12/13 00:13, Vincent Lefevre wrote:
> > In Profile → Colors, when "Use colors from system theme" is ticked,
> > the main text is invisible (black on black?).

Workaround 1: turn off "Use colors from system theme".

Workaround 2: set a non-awful Gtk theme (Gtk 3.12's default is "Raleigh"
which is very minimal and rather ugly) by installing gnome-themes-standard
and putting this in $XDG_CONFIG_HOME/gtk-3.0/settings.ini, which is usually
~/.config/gtk-3.0/settings.ini:

[Settings]
gtk-theme-name = Adwaita

(You might also notice that every other Gtk application looks a lot better
as a result.)

In Gtk 3.14, Adwaita has moved from gnome-themes-standard into Gtk
and is the default theme on all platforms.

> I suspect that the bug is that when some part of GNOME (possibly
> gnome-settings-daemon?) is not running, gnome-terminal fails to
> find the "system" theme colours, and instead of falling back to
> some sensible hard-coded default (black-on-white or white-on-black),
> it falls back to black-on-black.

The bug is actually that when gnome-terminal asks the theme engine
"what colours should I use to draw a TerminalScreen widget?",
the answer given by the Raleigh theme is "black on black",
which is not helpful. The attached patch falls back to
black-on-white (matching Adwaita) if that happens.

    S
>From 24df74c0b8f6c3593273ca32405feef8d53634a9 Mon Sep 17 00:00:00 2001
From: Simon McVittie <simon.mcvit...@collabora.co.uk>
Date: Wed, 30 Jul 2014 10:38:16 +0100
Subject: [PATCH] Don't allow the theme to set black-on-black

Gtk 3.12's Raleigh theme (the default in non-GNOME
environments) says a TerminalScreen should be drawn in
black-on-black, which is rather hopeless for usability.
Hard-code black-on-white (matching Adwaita) as a fallback.

Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=683744
---
 src/terminal-screen.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/src/terminal-screen.c b/src/terminal-screen.c
index ac971c0..cbf1491 100644
--- a/src/terminal-screen.c
+++ b/src/terminal-screen.c
@@ -862,6 +862,17 @@ update_color_scheme (TerminalScreen *screen)
   gtk_style_context_get_color (context, GTK_STATE_FLAG_NORMAL, &theme_fg);
   gtk_style_context_get_background_color (context, GTK_STATE_FLAG_NORMAL, &theme_bg);
 
+  if (theme_fg.red == 0.0 && theme_fg.green == 0.0 && theme_fg.blue == 0.0 &&
+      theme_bg.red == 0.0 && theme_bg.green == 0.0 && theme_bg.blue == 0.0)
+    {
+      /* The GTK-default Raleigh theme in 3.12 ends up assigning
+       * black background and black foreground, which is clearly not
+       * useful. */
+      theme_bg.red = 1.0;
+      theme_bg.green = 1.0;
+      theme_bg.blue = 1.0;
+    }
+
   if (g_settings_get_boolean (profile, TERMINAL_PROFILE_USE_THEME_COLORS_KEY) ||
       (!terminal_g_settings_get_rgba (profile, TERMINAL_PROFILE_FOREGROUND_COLOR_KEY, &fg) ||
        !terminal_g_settings_get_rgba (profile, TERMINAL_PROFILE_BACKGROUND_COLOR_KEY, &bg)))
-- 
2.0.1

Reply via email to