Skip to content

use RGBA visual regardless of CSD (fixes #3105)

Philipp Schaffrath requested to merge phisch/gtk:gtk-3-24 into gtk-3-24

GNOME

Since the GNOME desktop environment supports _GTK_FRAME_EXTENTS, we can ignore this parameter. Before this change, in GNOME, those scenarios would lead to an RGBA visual:

composited CSD uses RGBA visual?
no
no
no (but why?)
yes

After this change:

composited CSD uses RGBA visual?
no
no
yes
yes

Applications using CSD are unaffected by this change. They look the exact same and still allow themes to utilize transparency:

GNOME-CSD

Applications that do not use CSD also still look the same with any theme that does not explicitly make use of transparency. Unlike before, they now can make use of transparency though:

GNOME-NO-CSD

Also keep in mind, _GTK_FRAME_EXTENTS still works as expected, CSD receive their rounded corners, shadows are still drawn using the RGBA visual.

KDE

The last time this fix was attempted, KDE started rendering borders around shadows, so lets look at it next.

Applications with CSD still render their own shadow (smaller than the shadow drawn by KDE's own compositor as seen on the non CSD window) and support transparency. (like before, since KDE supports _GTK_FRAME_EXTENTS).

Applications without CSD still get their shadow and window decorations from KDE's own window manager and compositor. They now use the RRBA visual and can unlike before be transparent if the theme wants it.

KDE

No borders around shadows, no unexpected behavior.

Exotic setups

As an example for a more exotic setup, I am picking the window manager bspwm, and picom as a compositor. Bspwm does not support _GTK_FRAME_EXTENTS, so it would previously never had any window (neither CSD nor non-CSD) use the the RGBA visual.

Expected behavior for a wm that does not support _GTK_FRAME_EXTENTS would be that it does not render GTK's shadows for applications using CSD, but it still uses the RGBA visual (regardless of CSD), allowing for transparency.

bspwm

Since _GTK_FRAME_EXTENTS is not supported, all the shadows are still rendered by picom, and GTK3 does not attempt to render its own shadows. Both applications with and without CSD use the RGBA visual, which lets the theme render them transparent if it wants to.

Please let me know if you can think of any scenarios where this could potentially have an impact on, i am happy to test and clear up any concerns.

Merge request reports