Xpresent transparent window title bar

Carsten Haitzler raster at rasterman.com
Sun Feb 4 12:14:58 UTC 2024


On Sun, 04 Feb 2024 07:45:28 +0000 "Guy Rouillier" <guy.rouillier at gmail.com>
said:

> New member of this mailing list.
> 
> I've been using Windows 7 side by side with Linux (mostly Ubuntu MATE).  
> I'd like to use a couple of the features from the Aero interface from 
> Windows 7 on MATE  I've been discussing this topic on the Ubuntu MATE 
> community forum here:
> 
> https://ubuntu-mate.community/t/marco-xpresent-compositor-transparent-title-bars/26968/4
> 
> In brief, I'm trying to get semi-transparent task bar (accomplished), 
> inactive window background (accomplished) and window titlebars (not yet 
> accomplished with Xpresent.)  All of these features are achievable with 
> Compiz, but that consumes quite a bit of the CPU, so I'm seeing if I can 
> accomplish this with something less resource-intensive, like Xpresent or 
> Xrender.  As noted, with Xpresent, I haven't been able to achieve the 
> semi-transparent titlebars.
> 
> Is there any known way to get semi-transparent titlebars with Xpresent?  
> I'm looking at the /usr/share/themes/YaruOk/gtk-3.0/gtk.css file and 
> trying to figure out how I might modify the titlebar rendering in that 
> theme, but the code is difficult to decipher by someone not familiar 
> with it.
> 
> Thanks.  If this is not easily achievable, I'll switch my focus to 
> Xrender.

Your question really should be directed at the mate picom etc. developers, not
here unless you want to discuss the general x11 compositing and rendering
pipeline etc. .. so I'll answer from that point of view.

Well... I can't talk of mate itself... I have never worked on its code nor used
it, but as someone who writes WM + compositors and toolkits... I can tell you
what you need.

I assume the compositor is separate to the window manager in mate? If this is
the case you need them to cooperate. You need the WM to create its container
window it re-parents into with an ARGB visual at all times. You also need it to
draw the titlebar background (not text, buttons, etc.) with transparency (alpha
channel values < 255). I have no idea if it's capable of this. This
unfortunately leads to the downsides of lots of overdraw as the entire window
has to be blended regardless (unless there is further co-operation about there
being a solid non-transparent region).

If they are a combined compositor + WM then they already "co-operate" and it
just needs to draw the titlebar background with transparency when it draws it.

It's trivial to achieve this in enlightenment (what I work on)

http://www.enlightenment.org/ss/e-65bf7e7bb20c83.08008599.png

This is as easy as modifying the color of the titlebar background color class
with some transparency (there is a gui palette editor provided so you just
select the right color and slide alpha down... presto). You can lower it just
for inactive state or everything. Since enlightenment is a combined compositor
+ WM and it draws all the titlebars inside the compositor itself as part of the
compositing process. While client windows are re-parented, the decorations are
not drawn there and no space is left in there for them in the container window
(it's flush/borderless i.e. size of parent container win == size of client win
- the intend is to give the X11 driver the ability to implement zero copy
swaps on the client pixmaps if the client uses DRI for example). Since all the
decoration is done in compositor, all of this works (you can actually add a
blur filter part too that allows you to blur behind windows too like vista/7
if you want. The default theme does not have this but it's a small few line mod
on the theme files and presto - it works - see above). But that's not useful to
you as you use mate, so ... You need to talk to whoever works on your
WM and compositor as above.

-- 
------------- Codito, ergo sum - "I code, therefore I am" --------------
Carsten Haitzler - raster at rasterman.com



More information about the xorg mailing list