Better transparency implementation.

This commit is contained in:
Simon Gomizelj 2012-05-31 03:36:36 -04:00
parent 56c1f04cc6
commit 259ea27dbc
1 changed files with 5 additions and 4 deletions

View File

@ -226,10 +226,11 @@ int main(int argc, char **argv) {
#ifdef TRANSPARENCY #ifdef TRANSPARENCY
GdkScreen *screen = gtk_widget_get_screen(window); GdkScreen *screen = gtk_widget_get_screen(window);
GdkColormap *colormap = gdk_screen_get_rgba_colormap(screen); GdkVisual *visual = gdk_screen_get_rgba_visual(screen);
if (colormap != NULL) { if (visual == NULL)
gtk_widget_set_colormap(window, colormap); visual = gdk_screen_get_system_visual(screen);
}
gtk_widget_set_visual(GTK_WIDGET(window), visual);
vte_terminal_set_background_saturation(VTE_TERMINAL(vte), TRANSPARENCY); vte_terminal_set_background_saturation(VTE_TERMINAL(vte), TRANSPARENCY);
vte_terminal_set_opacity(VTE_TERMINAL(vte), (guint16)(0xffff * (1 - TRANSPARENCY))); vte_terminal_set_opacity(VTE_TERMINAL(vte), (guint16)(0xffff * (1 - TRANSPARENCY)));
#endif #endif