The subject says it all; pseudotransparency looks just weird in an environment with real window translucency.
mdw
[veers@darkvault fe-gtk]$ cvs diff -u
? .gtkutil.c.swp
? Makefile.in
? xtext2.c
cvs diff: Diffing .
Index: gtkutil.c
===================================================================
RCS file: /cvsroot/xchat/xchat2/src/fe-gtk/gtkutil.c,v
retrieving revision 1.30
diff -u -r1.30 gtkutil.c
--- gtkutil.c 31 Jan 2007 07:25:35 -0000 1.30
+++ gtkutil.c 20 Mar 2007 17:30:25 -0000
@@ -523,6 +523,14 @@
GtkWidget *win;
win = gtk_window_new (GTK_WINDOW_TOPLEVEL);
+ GdkScreen *screen;
+ GdkColormap *colormap;
+ screen = gtk_widget_get_screen(GTK_WIDGET(win));
+ colormap = gdk_screen_get_rgba_colormap(screen);
+ if(colormap != NULL && gdk_screen_is_composited (screen))
+ {
+ gtk_widget_set_colormap(GTK_WIDGET(win), colormap);
+ }
gtkutil_set_icon (win);
#ifdef WIN32
gtk_window_set_wmclass (GTK_WINDOW (win), "XChat", "xchat");
Index: xtext.c
===================================================================
RCS file: /cvsroot/xchat/xchat2/src/fe-gtk/xtext.c,v
retrieving revision 1.121
diff -u -r1.121 xtext.c
--- xtext.c 11 Dec 2006 02:52:42 -0000 1.121
+++ xtext.c 20 Mar 2007 17:30:27 -0000
@@ -4168,6 +4168,11 @@
xtext->color[i].color.alpha = 0xffff;
xtext->color[i].pixel = palette[i].pixel;
#endif
+ if(i==XTEXT_BG)
+ {
+ guint8* pixel = &palette[i].pixel;
+ pixel[3] = 0xdd;
+ }
xtext->palette[i] = palette[i].pixel;
}
[veers@darkvault fe-gtk]$ cvs diff -u
? .xtext.c.swp
? Makefile.in
cvs diff: Diffing .
Index: gtkutil.c
===================================================================
RCS file: /cvsroot/xchat/xchat2/src/fe-gtk/gtkutil.c,v
retrieving revision 1.30
diff -u -r1.30 gtkutil.c
--- gtkutil.c 31 Jan 2007 07:25:35 -0000 1.30
+++ gtkutil.c 21 Mar 2007 00:00:34 -0000
@@ -523,6 +523,14 @@
GtkWidget *win;
win = gtk_window_new (GTK_WINDOW_TOPLEVEL);
+ GdkScreen *screen;
+ GdkColormap *colormap;
+ screen = gtk_widget_get_screen(GTK_WIDGET(win));
+ colormap = gdk_screen_get_rgba_colormap(screen);
+ if(colormap != NULL && gdk_screen_is_composited (screen))
+ {
+ gtk_widget_set_colormap(GTK_WIDGET(win), colormap);
+ }
gtkutil_set_icon (win);
#ifdef WIN32
gtk_window_set_wmclass (GTK_WINDOW (win), "XChat", "xchat");
Index: xtext.c
===================================================================
RCS file: /cvsroot/xchat/xchat2/src/fe-gtk/xtext.c,v
retrieving revision 1.121
diff -u -r1.121 xtext.c
--- xtext.c 11 Dec 2006 02:52:42 -0000 1.121
+++ xtext.c 21 Mar 2007 00:00:39 -0000
@@ -994,6 +994,15 @@
gdk_window_set_user_data (widget->window, widget);
xtext->depth = gdk_drawable_get_visual (widget->window)->depth;
+ if(xtext->depth == 32)
+ {
+ if(xtext->transparent)
+ {
+ guint8* pixel = &xtext->palette[XTEXT_BG];
+ pixel[3] = 0xdd;
+ }
+ xtext->transparent = FALSE;
+ }
val.subwindow_mode = GDK_INCLUDE_INFERIORS;
val.graphics_exposures = 0;
@@ -4283,6 +4292,28 @@
if (trans && (xtext->tint_red != 255 || xtext->tint_green != 255 || xtext->tint_blue != 255))
shaded = TRUE;
+ /* rgba mode */
+ if(xtext->depth == 32)
+ {
+ if(trans)
+ {
+ guint8* pixel = &xtext->palette[XTEXT_BG];
+ pixel[3] = 0xdd;
+ }
+ else
+ {
+ guint8* pixel = &xtext->palette[XTEXT_BG];
+ pixel[3] = 0xff;
+ }
+ xtext_set_fg (xtext, xtext->fgc, XTEXT_FG);
+ xtext_set_bg (xtext, xtext->fgc, XTEXT_BG);
+ xtext_set_fg (xtext, xtext->bgc, XTEXT_BG);
+ /* rgba mode breaks the old transparency mechanism
+ * X11 Bad Match. */
+ trans = FALSE;
+ shaded = FALSE;
+ pixmap = 0;
+ }
#if !defined(USE_XLIB) && !defined(WIN32)
shaded = FALSE;
Users browsing this forum: Google [Bot] and 0 guests