[Xfce4-commits] [apps/xfce4-terminal] 01/01: Apply opacity setting by chaging background color alpha value

noreply at xfce.org noreply at xfce.org
Thu Jul 14 16:53:12 CEST 2016


This is an automated email from the git hooks/post-receive script.

f2404 pushed a commit to branch master
in repository apps/xfce4-terminal.

commit eaf24ad079016ed6c561e7ae9526f4170857f9a5
Author: Igor <f2404 at yandex.ru>
Date:   Thu Jul 14 17:50:41 2016 +0300

    Apply opacity setting by chaging background color alpha value
    
    Have to store background_color in the TerminalScreen object to allow
    modification of both colors and alpha values which are controlled by
    different preferences.
---
 terminal/terminal-screen.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/terminal/terminal-screen.c b/terminal/terminal-screen.c
index 3071ffa..ec17bf0 100644
--- a/terminal/terminal-screen.c
+++ b/terminal/terminal-screen.c
@@ -157,6 +157,8 @@ struct _TerminalScreen
   GtkWidget           *scrollbar;
   GtkWidget           *tab_label;
 
+  GdkRGBA              background_color;
+
   guint                session_id;
 
   gulong               background_signal_id;
@@ -917,9 +919,13 @@ terminal_screen_update_colors (TerminalScreen *screen)
 
   if (G_LIKELY (valid_palette))
     {
+      screen->background_color.red = bg.red;
+      screen->background_color.green = bg.green;
+      screen->background_color.blue = bg.blue;
+
       vte_terminal_set_colors (VTE_TERMINAL (screen->terminal),
                                has_fg ? &fg : NULL,
-                               has_bg ? &bg : NULL,
+                               has_bg ? &screen->background_color : NULL,
                                palette, 16);
     }
   else
@@ -1369,7 +1375,6 @@ terminal_screen_timer_background (gpointer user_data)
   TerminalImageLoader *loader;
   TerminalBackground   background_mode;
   GdkPixbuf           *image;
-  GtkWidget           *toplevel;
   gdouble              background_darkness;
 
   terminal_return_val_if_fail (TERMINAL_IS_SCREEN (screen), FALSE);
@@ -1424,8 +1429,8 @@ terminal_screen_timer_background (gpointer user_data)
   //vte_terminal_set_background_transparent (VTE_TERMINAL (screen->terminal),
   //                                         background_mode == TERMINAL_BACKGROUND_TRANSPARENT
   //                                         && !gtk_widget_is_composited (GTK_WIDGET (screen)));
-  toplevel = gtk_widget_get_toplevel (GTK_WIDGET (screen));
-  gtk_widget_set_opacity (toplevel, background_darkness);
+  screen->background_color.alpha = background_darkness;
+  vte_terminal_set_color_background (VTE_TERMINAL (screen->terminal), &screen->background_color);
 
   GDK_THREADS_LEAVE ();
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list