Identifiable GTK4 windows with client side shadows or irregular shapes
Since GTK4 popup menus with irregular shapes and shadows are actual windows instead of being rendered inside the parent window. This causes compositors to render a separate shadow around the actual window.
Here is an example of how this looks:
Disabling compositor shadows for all windows of the type menu
is not an option, since this would affect all non GTK windows of that type.
The issue is not only the shadow of the GTK4 window, but also its shape which it uses RGBA over instead of something like the X11 shape extension.
I see two possible solutions for this problem:
- set a X11 hint that says "i render my own shadow", something like
_HAS_CLIENT_SIDE_SHADOW
and/or_HAS_CLIENT_SIDE_IRREGULAR_SHAPE
for example
This would allow compositors to identify those windows and not draw a separate shadow for them or apply any other effects. Another example would be compositors that blur the window background, which could be avoided by the client side irregular shape hint.
- do a similar thing to what main GTK4 windows do
GTK4 windows don't draw shadows and rounded corners when the compositor/windowmanager doesn't support a certain feature (i forgot the name of it though). For the menu windows, this would also mean disabling the arrow because of the window shape.
Option one seems to be the easiest and also cleanest solution to this problem.