! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
A little patch to make root window background transparent if choosen color is...
Status:
RESOLVED: FIXED
Priority:
Very Low
Severity:
enhancement
Product:
Xfdesktop
Component:
General

Comments

Description Tofe 2008-07-06 19:20:20 CEST
Hello,

For some time I was trying to have Xfce and Compiz work together, i.e. have the cube and the nice effects of compiz and at the same time have the effective and user-friendly UI of Xfce.
The main problem here comes up when you try to have different background images on each cube's face. Even with compiz' wallpaper plugin, the root window created by xfdesktop is opaque, and therefore you don't really see what is "behind" (i.e. compiz' cube).

So I modified a little bit some parts of xfdesktop's source code, to enable the alpha channel on the root window. Also I fill the background with transparent pixels when the selected background color is pure black. The latter choice is not perfect at all, but it just works. And if you want to have a black background, there's no interest in applying this patch :)

This patch come "as-is", do whatever you want with this. The goal of putting it there is to be able to answer to the people who ask me where to find my patch; I hope this is the right place !
Comment 1 Tofe 2008-07-06 19:23:03 CEST
Created attachment 1732 
Patch to have an RGBA root window with transparent background when color is black

This patch is quite experimental. It worked fine for me, but may introduce bugs. It will certainly not crash your computer, but xfdesktop could have some unexpected visual bugs.
Comment 2 Brian J. Tarricone (not reading bugmail) 2008-07-06 22:18:11 CEST
There's actually much much easier way of doing this without using a RGBA colormap/visual or having to use cairo at all: gtk_window_set_opacity().  The only reason you'd need to use RGBA/cairo is if you wanted to have non-uniform transparency on the window.
Comment 3 Tofe 2008-07-07 05:28:41 CEST
Well in fact non uniform transparency is the only way to make the background transparent with xfdesktop, because the root window also includes the icons.
In addition (but I am not sure of that), it could be that if you set the whole window to be transparent, you would then not be able to click on it and have the xfce menu...
Comment 4 Brian J. Tarricone (not reading bugmail) 2008-07-07 05:49:29 CEST
(In reply to comment #3)
> Well in fact non uniform transparency is the only way to make the background
> transparent with xfdesktop, because the root window also includes the icons.

So you're saying you want to be able to have the window itself transparent, but still use desktop icons?  Oof.  Yeah, you've got the right idea, then, but your patch probably breaks compat with applications that don't know about window transparency and want to draw to the desktop window.  Ignoring the fact that I think black == transparent is somewhat silly ^_~.  I was planning on adding an extra color style (transparent), instead.  Basically it needs to have two code paths: the current one for normal operation, and your cairo/transparent-painting path for transparent operation.  Otherwise non-compiz users will see breakage with some apps when you (for example) don't set the window's back pixmap.  Need to think about this a bit more.

> In addition (but I am not sure of that), it could be that if you set the whole
> window to be transparent, you would then not be able to click on it and have
> the xfce menu..

No, that'll work fine.  Window opacity doesn't affect whether or not the window accepts input.
Comment 5 Tofe 2008-07-07 06:03:10 CEST
I completely agree with you: black=transparency is a weird and bad choice, and it can break compatibility [although we could speak of the weirdness of drawing into the root window, now that we have composite, but it's not the point here :) ]
At the beginning I wrote this patch mainly for my own needs; it just worked for what I wanted, so it was quite fine. However, please, don't include this patch into the main code :-) I'm aware of the "quality" of this patch, and it's far below the quality of the rest of the code. So for having transparency in xfdesktop's window in the main branch, I prefer waiting for your proposal !
Comment 6 Brian J. Tarricone (not reading bugmail) 2008-09-25 09:56:24 CEST
Ok, there's something similar to this in 4.6alpha.  Reopen if it's not enough.

Bug #4204

Reported by:
Tofe
Reported on: 2008-07-06
Last modified on: 2009-07-14

People

Assignee:
Brian J. Tarricone (not reading bugmail)
CC List:
0 users

Version

Attachments

Additional information