window-actor/x11: Don't use direct scanout if the window is not opaque

Some windows span the entire screen but still use transparency, such as
the desktop window of Nemo. When these windows were used for direct
scanout, the transparent areas would turn black and nothing else would
be rendered.

In addition to checking the surface for opaqueness, for X11 windows also
the window actor itself has to be checked, because its opacity might
have been changed via _NET_WM_WINDOW_OPACITY.

Fixes: https://gitlab.gnome.org/GNOME/mutter/-/issues/2263
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2409>
This commit is contained in:
Sebastian Keller 2022-05-11 22:41:29 +02:00 committed by Marge Bot
parent 9c8948fc04
commit dc43bb9f68

View File

@ -445,6 +445,9 @@ meta_window_actor_x11_get_scanout_candidate (MetaWindowActor *actor)
clutter_actor_get_last_child (CLUTTER_ACTOR (actor)))
return NULL;
if (!meta_window_actor_is_opaque (actor))
return NULL;
return surface_actor;
}