[mutter] compositor/native: Consider Wayland subsurfaces for scanout



commit df3f81e709b7df3fbc89192e146e9776fc29f115
Author: Robert Mader <robert mader posteo de>
Date:   Fri Jan 7 17:31:47 2022 +0100

    compositor/native: Consider Wayland subsurfaces for scanout
    
    If a Wayland subsurface is the topmost actor, consider in for
    scanout as well. This will extend our scanout capabilities to apps
    like Firefox
    
    While on it, correct a unnessary type check to a NULL check.
    
    Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2211>

 src/compositor/meta-compositor-native.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
---
diff --git a/src/compositor/meta-compositor-native.c b/src/compositor/meta-compositor-native.c
index 7822789a3e..dd77bb7ae7 100644
--- a/src/compositor/meta-compositor-native.c
+++ b/src/compositor/meta-compositor-native.c
@@ -95,9 +95,6 @@ maybe_assign_primary_plane (MetaCompositor *compositor)
   if (clutter_actor_has_transitions (CLUTTER_ACTOR (window_actor)))
     goto done;
 
-  if (clutter_actor_get_n_children (CLUTTER_ACTOR (window_actor)) != 1)
-    goto done;
-
   window = meta_window_actor_get_meta_window (window_actor);
   if (!window)
     goto done;
@@ -114,8 +111,10 @@ maybe_assign_primary_plane (MetaCompositor *compositor)
   if (!COGL_IS_ONSCREEN (framebuffer))
     goto done;
 
-  surface_actor = meta_window_actor_get_surface (window_actor);
-  if (!META_IS_SURFACE_ACTOR_WAYLAND (surface_actor))
+  surface_actor = meta_window_actor_get_topmost_surface (window_actor);
+  if (!surface_actor ||
+      CLUTTER_ACTOR (surface_actor) !=
+      clutter_actor_get_last_child (CLUTTER_ACTOR (window_actor)))
     goto done;
   surface_actor_wayland = META_SURFACE_ACTOR_WAYLAND (surface_actor);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]