[mutter/gnome-3-32] wayland/actor-surface: Queue redraw for frame callback



commit a38dc8c61d48fd375d4bf41b3a3cbdb0a1a8caa9
Author: Jonas Ã…dahl <jadahl gmail com>
Date:   Wed Oct 9 21:53:09 2019 +0200

    wayland/actor-surface: Queue redraw for frame callback
    
    A frame callback without damage is still expected to be responded to.
    Implement this by simply queuing damage if there are any frame callbacks
    requested and there is no damage yet. If there already is damage,
    we'll be queued already, but with more correct damage. Without we simply
    need to make sure we flush the callbacks if any area of surface is not
    occluded.
    
    Fixes: https://gitlab.gnome.org/GNOME/mutter/issues/457
    
    https://gitlab.gnome.org/GNOME/mutter/merge_requests/839
    
    (cherry picked from commit d49d10b14f4e0fa80e6867979b26fab383610b39)
    
    Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1813>

 src/wayland/meta-wayland-actor-surface.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
---
diff --git a/src/wayland/meta-wayland-actor-surface.c b/src/wayland/meta-wayland-actor-surface.c
index 2471de0a92..1b7b749534 100644
--- a/src/wayland/meta-wayland-actor-surface.c
+++ b/src/wayland/meta-wayland-actor-surface.c
@@ -253,10 +253,20 @@ meta_wayland_actor_surface_commit (MetaWaylandSurfaceRole  *surface_role,
 {
   MetaWaylandActorSurface *actor_surface =
     META_WAYLAND_ACTOR_SURFACE (surface_role);
+  MetaWaylandActorSurfacePrivate *priv =
+    meta_wayland_actor_surface_get_instance_private (actor_surface);
   MetaWaylandSurface *surface =
     meta_wayland_surface_role_get_surface (surface_role);
   MetaWaylandSurface *toplevel_surface;
 
+  if (!priv->actor)
+    return;
+
+  if (!wl_list_empty (&pending->frame_callback_list) &&
+      cairo_region_is_empty (pending->surface_damage) &&
+      cairo_region_is_empty (pending->buffer_damage))
+    clutter_actor_queue_redraw (CLUTTER_ACTOR (priv->actor));
+
   meta_wayland_actor_surface_queue_frame_callbacks (actor_surface, pending);
 
   toplevel_surface = meta_wayland_surface_get_toplevel (surface);


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