[mutter] wayland: Use notify::allocation notification to update surface outputs
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] wayland: Use notify::allocation notification to update surface outputs
- Date: Mon, 22 May 2017 15:33:44 +0000 (UTC)
commit cf1edff9ed0c3f20171e75bbbb5d7c0616f1c38d
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 | 25 ++++++++++++++++---------
1 files changed, 16 insertions(+), 9 deletions(-)
---
diff --git a/src/wayland/meta-wayland-surface.c b/src/wayland/meta-wayland-surface.c
index 5a0e0ee..10a7aab 100644
--- a/src/wayland/meta-wayland-surface.c
+++ b/src/wayland/meta-wayland-surface.c
@@ -176,6 +176,10 @@ static void
surface_actor_mapped_notify (MetaSurfaceActorWayland *surface_actor,
GParamSpec *pspec,
MetaWaylandSurface *surface);
+static void
+surface_actor_allocation_notify (MetaSurfaceActorWayland *surface_actor,
+ GParamSpec *pspec,
+ MetaWaylandSurface *surface);
static void
unset_param_value (GParameter *param)
@@ -414,6 +418,9 @@ meta_wayland_surface_destroy_window (MetaWaylandSurface *surface)
g_signal_handlers_disconnect_by_func (surface->surface_actor,
surface_actor_mapped_notify,
surface);
+ g_signal_handlers_disconnect_by_func (surface->surface_actor,
+ surface_actor_allocation_notify,
+ surface);
meta_window_unmanage (surface->window, timestamp);
}
@@ -1291,16 +1298,17 @@ wl_surface_destructor (struct wl_resource *resource)
}
static void
-surface_actor_painting (MetaSurfaceActorWayland *surface_actor,
- MetaWaylandSurface *surface)
+surface_actor_mapped_notify (MetaSurfaceActorWayland *surface_actor,
+ GParamSpec *pspec,
+ MetaWaylandSurface *surface)
{
meta_wayland_surface_update_outputs (surface);
}
static void
-surface_actor_mapped_notify (MetaSurfaceActorWayland *surface_actor,
- GParamSpec *pspec,
- MetaWaylandSurface *surface)
+surface_actor_allocation_notify (MetaSurfaceActorWayland *surface_actor,
+ GParamSpec *pspec,
+ MetaWaylandSurface *surface)
{
meta_wayland_surface_update_outputs (surface);
}
@@ -1324,10 +1332,9 @@ 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_allocation_notify),
+ surface, 0);
g_signal_connect_object (surface->surface_actor,
"notify::mapped",
G_CALLBACK (surface_actor_mapped_notify),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]