Did you know? [random xchat facts]
Double middle-clicking a nickname in the text area will select it in the userlist.
xchat.org
XChat IRC Client
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

True transparency in Xgl/AIGLX
Goto page 1, 2  Next
 
Post new topic   Reply to topic    xchat.org Forum Index -> Feature Requests
View previous topic :: View next topic  
Author Message
mdw



Joined: 11 Oct 2006
Posts: 2

PostPosted: Wed Oct 11, 2006 12:24 pm    Post subject: True transparency in Reply with quote

The subject says it all; pseudotransparency looks just weird in an environment with real window translucency.

mdw
Back to top
View user's profile Send private message
peterz



Joined: 09 Jun 2004
Posts: 979
Location: Australia

PostPosted: Wed Oct 11, 2006 12:29 pm    Post subject: Re: True transparenc Reply with quote

[quote:0e3b00cf42="mdw"]The subject says it all; pseudotransparency looks just weird in an environment with real window translucency.

mdw[/quote:0e3b00cf42]

Sounds good. Which distros & versions have Xgl now?
Back to top
View user's profile Send private message
mdw



Joined: 11 Oct 2006
Posts: 2

PostPosted: Wed Oct 11, 2006 12:42 pm    Post subject: Re: True transparenc Reply with quote

[quote:bf305bea4e]Sounds good. Which distros & versions have Xgl now?[/quote:bf305bea4e]

Mandriva 2007 and SuSE 10.1 at this moment, with more to come. Mandriva even has live CD called Mandriva One with Xgl/AIGLX/Compiz. gnome-terminal and rxvt-unicode have native support for true transparency.

mdw
Back to top
View user's profile Send private message
funkyhat



Joined: 09 Dec 2006
Posts: 2
Location: Northampton, UK

PostPosted: Sat Dec 09, 2006 1:57 pm    Post subject: Reply with quote

Ubuntu 6.10 (possibly 6.06 too actually...)
Gentoo
Probably most of the major distros have it as an option now as it's been around for quite a while...
The method could probably be copied from the gnome-terminal app.
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
funkyhat



Joined: 09 Dec 2006
Posts: 2
Location: Northampton, UK

PostPosted: Thu Mar 08, 2007 10:48 pm    Post subject: Reply with quote

Just giving this a bump...

Ubuntu 7.04 is to have composite support installed by default, Mandriva has had composite for a long time. All other main distros can configure composite relatively easily if it's not already done.

I'll post a screenshot of gnome-terminal with translucency set if anyone's interested but can't be bothered to play themselves Wink
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
veers



Joined: 20 Mar 2007
Posts: 6

PostPosted: Tue Mar 20, 2007 1:16 am    Post subject: Reply with quote

Well, I've got a prototype up and running Wink
Back to top
View user's profile Send private message
peterz



Joined: 09 Jun 2004
Posts: 979
Location: Australia

PostPosted: Tue Mar 20, 2007 1:54 am    Post subject: Reply with quote

Looking good. Looks like the only problem left is the background behind the text?
What's the speed like?
Back to top
View user's profile Send private message
veers



Joined: 20 Mar 2007
Posts: 6

PostPosted: Tue Mar 20, 2007 5:35 pm    Post subject: Reply with quote

I've fixed the issue with the text background.


The performance is good on my notebook using an Intel 945GM gpu.
At the moment everything is hardcoded. Disable your background image and transparent background/tinting before using the patch, at least on fedora core 6 you'll get a X11 error otherwise.

Anyway here is the patch:
Code:
[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;
        }
 
Please give it a try. In the meantime I'll try to make it replace the existing transparent background functionality ...somehow.
Back to top
View user's profile Send private message
veers



Joined: 20 Mar 2007
Posts: 6

PostPosted: Wed Mar 21, 2007 12:03 am    Post subject: Reply with quote

Code:
[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;

Now it replaces the pseudo transparency with the real one. Still pretty ugly but at least working.
Back to top
View user's profile Send private message
AccoGrayfox



Joined: 30 Apr 2007
Posts: 1

PostPosted: Mon Apr 30, 2007 3:06 am    Post subject: Reply with quote

Hi, I know I'm probably going to be crucified for reviving a close-to-one-month old topic, but how exactly do you apply the patches? I've tried with my limited knowledge, but don't understand how it works. (or a simple .patch file would be nice Very Happy)
Back to top
View user's profile Send private message
veers



Joined: 20 Mar 2007
Posts: 6

PostPosted: Fri May 04, 2007 12:15 am    Post subject: Reply with quote

I'll upload a .patch file for you tomorrow/in some hours.

edit:
http://www.swiss-bash.ch/static/xchat-alpha.patch

to apply:
patch -u < xchat-alpha.patch
Back to top
View user's profile Send private message
atrus



Joined: 05 May 2008
Posts: 1

PostPosted: Mon May 05, 2008 12:43 am    Post subject: Reply with quote

Anybody looking at this? (Reviving a year old thread, to say nothing of reviving a month old one...)
Back to top
View user's profile Send private message
DASPRiD



Joined: 06 Jul 2008
Posts: 1

PostPosted: Sun Jul 06, 2008 12:30 pm    Post subject: Reply with quote

I just tested it with the newest version of X-Chat, works fine. Should be integrated by default into the release version.
Back to top
View user's profile Send private message
kthxbye



Joined: 25 Jun 2008
Posts: 5

PostPosted: Wed Jul 09, 2008 2:46 am    Post subject: Reply with quote

Hi.

How would I go about doing this? I've not a clue. I see the lil patch command but.. what do I do? >,<
Back to top
View user's profile Send private message
s0ulslack



Joined: 07 Oct 2005
Posts: 13
Location: Idaho

PostPosted: Thu Sep 25, 2008 3:29 am    Post subject: bump Reply with quote

bump #69 Wink

Anyway to merge this patch and have an "true trans" GUI option if correct additions appear?
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    xchat.org Forum Index -> Feature Requests All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group