diff --git a/terminatorlib/terminator.py b/terminatorlib/terminator.py index 4ad0055b..731942c1 100755 --- a/terminatorlib/terminator.py +++ b/terminatorlib/terminator.py @@ -414,11 +414,19 @@ class Terminator(Borg): profiles = self.config.base.profiles for profile in profiles.keys(): if profiles[profile]['use_theme_colors']: - # FIXME: This dummy vte has different system colors to the real ones - bgcolor = Vte.Terminal().get_style_context().get_background_color(Gtk.StateType.NORMAL) + # Create a dummy window/vte and realise it so it has correct + # values to read from + tmp_win = Gtk.Window() + tmp_vte = Vte.Terminal() + tmp_win.add(tmp_vte) + tmp_win.realize() + bgcolor = tmp_vte.get_style_context().get_background_color(Gtk.StateType.NORMAL) bgcolor = "#{0:02x}{1:02x}{2:02x}".format(int(bgcolor.red * 255), int(bgcolor.green * 255), int(bgcolor.blue * 255)) + tmp_win.remove(tmp_vte) + del(tmp_vte) + del(tmp_win) else: bgcolor = Gdk.RGBA() bgcolor = profiles[profile]['background_color']