only set the rgba visual when required
This commit is contained in:
parent
83820ffb92
commit
4b749020ae
18
termite.cc
18
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 (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_background_saturation(vte, cfgdouble);
|
||||||
vte_terminal_set_opacity(vte, (guint16)(0xffff * (1 - 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();
|
GtkWidget *vte_widget = vte_terminal_new();
|
||||||
VteTerminal *vte = VTE_TERMINAL(vte_widget);
|
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) {
|
if (role) {
|
||||||
gtk_window_set_role(GTK_WINDOW(window), role);
|
gtk_window_set_role(GTK_WINDOW(window), role);
|
||||||
g_free(role);
|
g_free(role);
|
||||||
|
|
Loading…
Reference in New Issue