wayland/compositor: Only emit frame callbacks for the primary stage view

Since we schedule frames for each stage view seperately now, surfaces receive
frame callbacks for each stage view they are visible on.

Only emit frame callbacks for the primary stage view.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1468>
This commit is contained in:
Robert Mader 2020-10-22 23:16:28 +02:00
parent ff94ed0ebf
commit c78b03bd50

View File

@ -30,6 +30,7 @@
#include "clutter/clutter.h" #include "clutter/clutter.h"
#include "clutter/wayland/clutter-wayland-compositor.h" #include "clutter/wayland/clutter-wayland-compositor.h"
#include "compositor/meta-surface-actor-wayland.h"
#include "core/main-private.h" #include "core/main-private.h"
#include "wayland/meta-wayland-buffer.h" #include "wayland/meta-wayland-buffer.h"
#include "wayland/meta-wayland-data-device.h" #include "wayland/meta-wayland-data-device.h"
@ -212,6 +213,7 @@ on_after_update (ClutterStage *stage,
MetaWaylandSurface *surface = l->data; MetaWaylandSurface *surface = l->data;
MetaSurfaceActor *actor; MetaSurfaceActor *actor;
MetaWaylandActorSurface *actor_surface; MetaWaylandActorSurface *actor_surface;
ClutterStageView *surface_primary_view;
l = l->next; l = l->next;
@ -219,12 +221,9 @@ on_after_update (ClutterStage *stage,
if (!actor) if (!actor)
continue; continue;
if (!clutter_actor_has_mapped_clones (CLUTTER_ACTOR (actor)) && surface_primary_view =
meta_surface_actor_is_obscured (actor)) meta_surface_actor_wayland_get_current_primary_view (actor, stage);
continue; if (stage_view != surface_primary_view)
if (!clutter_actor_is_effectively_on_stage_view (CLUTTER_ACTOR (actor),
stage_view))
continue; continue;
actor_surface = META_WAYLAND_ACTOR_SURFACE (surface->role); actor_surface = META_WAYLAND_ACTOR_SURFACE (surface->role);