x11 windows with CWOverrideRedirect are badly broken
Affected version
OS: Ubuntu 20 Mutter versions affected: 3.36.9 Bisected to this:
c9c32835 is the first bad commit commit c9c32835 Author: Daniel van Vugt daniel.van.vugt@canonical.com Date: Wed May 9 15:08:40 2018 +0800
shaped-texture: Disable mipmapping during animation
This avoids overwhelming the GPU with trying to update mipmaps at a high
rate. Because doing so could easily cause a reduction in the compositor
frame rate and thus actually reduce visual quality.
In the case of a window that is constantly animating in the overview,
this reduces mutter's render time by around 20%-30%.
src/compositor/meta-shaped-texture.c | 88 +++++++++++++++++++++++++++++++++--- 1 file changed, 82 insertions(+), 6 deletions(-)
Bug summary
Native x11 windows without decorations (CWOverrideRedirect=false) and with size matching display size, are badly broken. After a call to XReparentWindow of such a window to another, normal window, it doesn't show up, even though receives all X11 events. The new parent window is allowed to paint all over it, as if its gc.subwindow_mode is set to IncludeInferiors (it is ClipByChildren, as expected).
Steps to reproduce
The example xfsbug is attached. If you run it, it creates a red normal window and a green window without decoration inside it. The example reacts on the enter key, flipping the state of the green window, fullscreen and back. The first flip should show you a fullscreen green window, and that not a bug yet. The second flip should reparent the green window back to the red one, and that's where the bug manifests itself.
If there is no bug, only green window will be shown. If there is the bug, the window will be red.
Also, if the program is run with any arguments, it creates the fullscreen window with 1 pixel less height, and that's where there is no bug.