However it breaks transparency for gtk2.

This commit is contained in:
Simon Gomizelj 2012-05-31 03:50:40 -04:00
parent 259ea27dbc
commit b43ad9154f
2 changed files with 10 additions and 0 deletions

View File

@ -3,6 +3,7 @@ PREFIX = /usr/local
ifeq (${GTK3}, 1) ifeq (${GTK3}, 1)
GTK = gtk+-3.0 GTK = gtk+-3.0
VTE = vte-2.90 VTE = vte-2.90
CFLAGS += -DGTK3
else else
GTK = gtk+-2.0 GTK = gtk+-2.0
VTE = vte VTE = vte

View File

@ -226,11 +226,20 @@ int main(int argc, char **argv) {
#ifdef TRANSPARENCY #ifdef TRANSPARENCY
GdkScreen *screen = gtk_widget_get_screen(window); GdkScreen *screen = gtk_widget_get_screen(window);
#ifdef GTK3
GdkVisual *visual = gdk_screen_get_rgba_visual(screen); GdkVisual *visual = gdk_screen_get_rgba_visual(screen);
if (visual == NULL) if (visual == NULL)
visual = gdk_screen_get_system_visual(screen); visual = gdk_screen_get_system_visual(screen);
gtk_widget_set_visual(GTK_WIDGET(window), visual); gtk_widget_set_visual(GTK_WIDGET(window), visual);
#else
GdkColormap *colormap = gdk_screen_get_rgba_colormap(screen);
if (colormap != NULL) {
gtk_widget_set_colormap(window, colormap);
}
#endif
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