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
This commit is contained in:
Carlos Garnacho 2017-05-06 22:47:24 +02:00
parent 5cb5baa7d4
commit cf1edff9ed

View File

@ -176,6 +176,10 @@ static void
surface_actor_mapped_notify (MetaSurfaceActorWayland *surface_actor, surface_actor_mapped_notify (MetaSurfaceActorWayland *surface_actor,
GParamSpec *pspec, GParamSpec *pspec,
MetaWaylandSurface *surface); MetaWaylandSurface *surface);
static void
surface_actor_allocation_notify (MetaSurfaceActorWayland *surface_actor,
GParamSpec *pspec,
MetaWaylandSurface *surface);
static void static void
unset_param_value (GParameter *param) 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, g_signal_handlers_disconnect_by_func (surface->surface_actor,
surface_actor_mapped_notify, surface_actor_mapped_notify,
surface); surface);
g_signal_handlers_disconnect_by_func (surface->surface_actor,
surface_actor_allocation_notify,
surface);
meta_window_unmanage (surface->window, timestamp); meta_window_unmanage (surface->window, timestamp);
} }
@ -1291,14 +1298,15 @@ wl_surface_destructor (struct wl_resource *resource)
} }
static void static void
surface_actor_painting (MetaSurfaceActorWayland *surface_actor, surface_actor_mapped_notify (MetaSurfaceActorWayland *surface_actor,
GParamSpec *pspec,
MetaWaylandSurface *surface) MetaWaylandSurface *surface)
{ {
meta_wayland_surface_update_outputs (surface); meta_wayland_surface_update_outputs (surface);
} }
static void static void
surface_actor_mapped_notify (MetaSurfaceActorWayland *surface_actor, surface_actor_allocation_notify (MetaSurfaceActorWayland *surface_actor,
GParamSpec *pspec, GParamSpec *pspec,
MetaWaylandSurface *surface) MetaWaylandSurface *surface)
{ {
@ -1324,10 +1332,9 @@ meta_wayland_surface_create (MetaWaylandCompositor *compositor,
wl_list_init (&surface->pending_frame_callback_list); wl_list_init (&surface->pending_frame_callback_list);
g_signal_connect_object (surface->surface_actor, g_signal_connect_object (surface->surface_actor,
"painting", "notify::allocation",
G_CALLBACK (surface_actor_painting), G_CALLBACK (surface_actor_allocation_notify),
surface, surface, 0);
0);
g_signal_connect_object (surface->surface_actor, g_signal_connect_object (surface->surface_actor,
"notify::mapped", "notify::mapped",
G_CALLBACK (surface_actor_mapped_notify), G_CALLBACK (surface_actor_mapped_notify),