From 4b749020ae5ef3285dc112fbfeb9120b04737f73 Mon Sep 17 00:00:00 2001 From: Daniel Micay Date: Tue, 18 Sep 2012 04:17:11 -0400 Subject: [PATCH] only set the rgba visual when required --- termite.cc | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/termite.cc b/termite.cc index 69882f3..5f0851b 100644 --- a/termite.cc +++ b/termite.cc @@ -900,6 +900,15 @@ static void load_config(GtkWindow *window, VteTerminal *vte, config_info *info, } if (get_config_double(config, "options", "transparency", &cfgdouble)) { + if (cfgdouble > 0.0) { + GdkScreen *screen = gtk_widget_get_screen(GTK_WIDGET(window)); + GdkVisual *visual = gdk_screen_get_rgba_visual(screen); + if (!visual) { + visual = gdk_screen_get_system_visual(screen); + } + gtk_widget_set_visual(GTK_WIDGET(window), visual); + } + vte_terminal_set_background_saturation(vte, cfgdouble); vte_terminal_set_opacity(vte, (guint16)(0xffff * (1 - cfgdouble))); } @@ -1000,15 +1009,6 @@ int main(int argc, char **argv) { GtkWidget *vte_widget = vte_terminal_new(); VteTerminal *vte = VTE_TERMINAL(vte_widget); -#if 0 - GdkScreen *screen = gtk_widget_get_screen(window); - GdkVisual *visual = gdk_screen_get_rgba_visual(screen); - if (!visual) { - visual = gdk_screen_get_system_visual(screen); - } - gtk_widget_set_visual(window, visual); -#endif - if (role) { gtk_window_set_role(GTK_WINDOW(window), role); g_free(role);