Package: gnome-terminal / 3.30.2-2

Don-t-allow-the-theme-to-set-black-on-black.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
From: Simon McVittie <smcv@debian.org>
Date: Wed, 30 Jul 2014 10:38:16 +0100
Subject: Don't allow the theme to set black-on-black

Gtk 3.12's Raleigh theme (the default in non-GNOME environments)
is rather minimal, and in particular results in the TerminalScreen widget
being drawn in black-on-black whenever an application does not select
other colours via ANSI escapes, which is rather hopeless for usability.
Hard-code black-on-white (matching Adwaita) as a fallback.

This affects users who meet all of these conditions:

* run a desktop environment that does not set the Gtk theme via Xsettings
  (as gnome-settings-daemon does)
* have not configured the Adwaita theme (or some other reasonably
  complete Gtk theme) in ~/.config/gtk-3.0/settings.ini
* have left the "Use colors from system theme" preference enabled,
  as it is by default

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=734601
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 a85fcef..a4da042 100644
--- a/src/terminal-screen.c
+++ b/src/terminal-screen.c
@@ -883,6 +883,17 @@ update_color_scheme (TerminalScreen *screen)
   gtk_style_context_get_color (context, gtk_style_context_get_state (context), &theme_fg);
   gtk_style_context_get_background_color (context, gtk_style_context_get_state (context), &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;
+    }
+
   use_theme_colors = g_settings_get_boolean (profile, TERMINAL_PROFILE_USE_THEME_COLORS_KEY);
   if (use_theme_colors ||
       (!terminal_g_settings_get_rgba (profile, TERMINAL_PROFILE_FOREGROUND_COLOR_KEY, &fg) ||