window-actor/wayland: Only use scanout for opaque non-fullscreen windows

This could for example happen with the client window created by the
desktop-icons-ng extension which spans the entire desktop, but is not a
fullscreen window and uses transparency

On Wayland only opaque surfaces or transparent surfaces of fullscreen
windows can be used for direct scanout.

Related: 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:49:08 +02:00 committed by Marge Bot
parent dc43bb9f68
commit 54ba64b9f2

View File

@ -93,6 +93,7 @@ meta_window_actor_wayland_get_scanout_candidate (MetaWindowActor *actor)
{
ClutterActor *child_actor;
MetaSurfaceActor *topmost_surface_actor;
MetaWindow *window;
child_actor = clutter_actor_get_last_child (CLUTTER_ACTOR (actor));
if (!child_actor || !META_IS_SURFACE_ACTOR_WAYLAND (child_actor))
@ -100,6 +101,11 @@ meta_window_actor_wayland_get_scanout_candidate (MetaWindowActor *actor)
topmost_surface_actor = META_SURFACE_ACTOR (child_actor);
window = meta_window_actor_get_meta_window (actor);
if (!meta_window_is_fullscreen (window) &&
!meta_surface_actor_is_opaque (topmost_surface_actor))
return NULL;
return topmost_surface_actor;
}