[mutter/wip/carlosg/performance-improvements: 17/23] wayland: Use notify::allocation notification to update surface outputs



commit e4c05b22604ce400446afe83122a8ad75750e5ae
Author: Carlos Garnacho <carlosg gnome org>
Date:   Sat May 6 22:47:24 2017 +0200

    wayland: Use notify::allocation notification to update surface outputs
    
    Instead of updating the surface outputs on each actor ::paint.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=782344

 src/wayland/meta-wayland-surface.c |   30 +++++++++++-------------------
 1 files changed, 11 insertions(+), 19 deletions(-)
---
diff --git a/src/wayland/meta-wayland-surface.c b/src/wayland/meta-wayland-surface.c
index d4365fa..2f130f5 100644
--- a/src/wayland/meta-wayland-surface.c
+++ b/src/wayland/meta-wayland-surface.c
@@ -173,9 +173,9 @@ meta_wayland_surface_role_shell_surface_managed (MetaWaylandSurfaceRoleShellSurf
                                                  MetaWindow                         *window);
 
 static void
-surface_actor_mapped_notify (MetaSurfaceActorWayland *surface_actor,
-                             GParamSpec              *pspec,
-                             MetaWaylandSurface      *surface);
+surface_actor_property_notify (MetaSurfaceActorWayland *surface_actor,
+                               GParamSpec              *pspec,
+                               MetaWaylandSurface      *surface);
 
 static void
 unset_param_value (GParameter *param)
@@ -412,7 +412,7 @@ meta_wayland_surface_destroy_window (MetaWaylandSurface *surface)
       guint32 timestamp = meta_display_get_current_time_roundtrip (display);
 
       g_signal_handlers_disconnect_by_func (surface->surface_actor,
-                                            surface_actor_mapped_notify,
+                                            surface_actor_property_notify,
                                             surface);
 
       meta_window_unmanage (surface->window, timestamp);
@@ -1283,16 +1283,9 @@ wl_surface_destructor (struct wl_resource *resource)
 }
 
 static void
-surface_actor_painting (MetaSurfaceActorWayland *surface_actor,
-                        MetaWaylandSurface      *surface)
-{
-  meta_wayland_surface_update_outputs (surface);
-}
-
-static void
-surface_actor_mapped_notify (MetaSurfaceActorWayland *surface_actor,
-                             GParamSpec              *pspec,
-                             MetaWaylandSurface      *surface)
+surface_actor_property_notify (MetaSurfaceActorWayland *surface_actor,
+                               GParamSpec              *pspec,
+                               MetaWaylandSurface      *surface)
 {
   meta_wayland_surface_update_outputs (surface);
 }
@@ -1316,13 +1309,12 @@ meta_wayland_surface_create (MetaWaylandCompositor *compositor,
   wl_list_init (&surface->pending_frame_callback_list);
 
   g_signal_connect_object (surface->surface_actor,
-                           "painting",
-                           G_CALLBACK (surface_actor_painting),
-                           surface,
-                           0);
+                           "notify::allocation",
+                           G_CALLBACK (surface_actor_property_notify),
+                           surface, 0);
   g_signal_connect_object (surface->surface_actor,
                            "notify::mapped",
-                           G_CALLBACK (surface_actor_mapped_notify),
+                           G_CALLBACK (surface_actor_property_notify),
                            surface, 0);
 
   sync_drag_dest_funcs (surface);


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