diff --git a/src/wayland/meta-wayland-actor-surface.c b/src/wayland/meta-wayland-actor-surface.c index 2471de0a92f552d1b2028893f0b842c3d7a7d5db..bd987e970c65405d7169215ab235b6cd738ef2da 100644 --- a/src/wayland/meta-wayland-actor-surface.c +++ b/src/wayland/meta-wayland-actor-surface.c @@ -253,16 +253,9 @@ meta_wayland_actor_surface_commit (MetaWaylandSurfaceRole *surface_role, { MetaWaylandActorSurface *actor_surface = META_WAYLAND_ACTOR_SURFACE (surface_role); - MetaWaylandSurface *surface = - meta_wayland_surface_role_get_surface (surface_role); - MetaWaylandSurface *toplevel_surface; meta_wayland_actor_surface_queue_frame_callbacks (actor_surface, pending); - toplevel_surface = meta_wayland_surface_get_toplevel (surface); - if (!toplevel_surface || !toplevel_surface->window) - return; - meta_wayland_actor_surface_sync_actor_state (actor_surface); } diff --git a/src/wayland/meta-wayland-dnd-surface.c b/src/wayland/meta-wayland-dnd-surface.c index 2aad6dcd5d0910f2cb4b4d56bdaa4e3865bfb359..ae60f53e8f73f66ff4d5d801f6c72b45825f6af4 100644 --- a/src/wayland/meta-wayland-dnd-surface.c +++ b/src/wayland/meta-wayland-dnd-surface.c @@ -45,8 +45,12 @@ dnd_surface_commit (MetaWaylandSurfaceRole *surface_role, { MetaWaylandSurface *surface = meta_wayland_surface_role_get_surface (surface_role); + MetaWaylandSurfaceRoleClass *surface_role_class = + META_WAYLAND_SURFACE_ROLE_CLASS (meta_wayland_surface_role_dnd_parent_class); meta_wayland_surface_queue_pending_state_frame_callbacks (surface, pending); + + surface_role_class->commit (surface_role, pending); } static void diff --git a/src/wayland/meta-wayland-shell-surface.c b/src/wayland/meta-wayland-shell-surface.c index 04f2aaeea8534a17ddd0ece27c41a6e5bc6321ad..f8354ab7c5e726bae6de77e8233c24576d22ce39 100644 --- a/src/wayland/meta-wayland-shell-surface.c +++ b/src/wayland/meta-wayland-shell-surface.c @@ -175,6 +175,22 @@ meta_wayland_shell_surface_surface_commit (MetaWaylandSurfaceRole *surface_role window->buffer_rect.height = cogl_texture_get_height (texture) * scale; } +static void +meta_wayland_shell_surface_sync_actor_state (MetaWaylandActorSurface *actor_surface) +{ + MetaWaylandSurfaceRole *surface_role = + META_WAYLAND_SURFACE_ROLE (actor_surface); + MetaWaylandSurface *surface = + meta_wayland_surface_role_get_surface (surface_role); + MetaWaylandActorSurfaceClass *actor_surface_class = + META_WAYLAND_ACTOR_SURFACE_CLASS (meta_wayland_shell_surface_parent_class); + MetaWaylandSurface *toplevel_surface; + + toplevel_surface = meta_wayland_surface_get_toplevel (surface); + if (toplevel_surface && toplevel_surface->window) + actor_surface_class->sync_actor_state (actor_surface); +} + static void meta_wayland_shell_surface_init (MetaWaylandShellSurface *role) { @@ -185,6 +201,10 @@ meta_wayland_shell_surface_class_init (MetaWaylandShellSurfaceClass *klass) { MetaWaylandSurfaceRoleClass *surface_role_class = META_WAYLAND_SURFACE_ROLE_CLASS (klass); + MetaWaylandActorSurfaceClass *actor_surface_class = + META_WAYLAND_ACTOR_SURFACE_CLASS (klass); surface_role_class->commit = meta_wayland_shell_surface_surface_commit; + actor_surface_class->sync_actor_state = + meta_wayland_shell_surface_sync_actor_state; } diff --git a/src/wayland/meta-wayland-subsurface.c b/src/wayland/meta-wayland-subsurface.c index e0fa0a48b2424c273f55002a7c7e57c2949797e7..bde7bef6ea68cb1648ddfcd1dccd622141a307d7 100644 --- a/src/wayland/meta-wayland-subsurface.c +++ b/src/wayland/meta-wayland-subsurface.c @@ -199,8 +199,11 @@ meta_wayland_subsurface_sync_actor_state (MetaWaylandActorSurface *actor_surface meta_wayland_surface_role_get_surface (surface_role); MetaWaylandActorSurfaceClass *actor_surface_class = META_WAYLAND_ACTOR_SURFACE_CLASS (meta_wayland_subsurface_parent_class); + MetaWaylandSurface *toplevel_surface; - actor_surface_class->sync_actor_state (actor_surface); + toplevel_surface = meta_wayland_surface_get_toplevel (surface); + if (toplevel_surface && toplevel_surface->window) + actor_surface_class->sync_actor_state (actor_surface); sync_actor_subsurface_state (surface); } diff --git a/src/wayland/meta-xwayland.c b/src/wayland/meta-xwayland.c index 90fdd222b133242c7566fc7dfa4ab9a20bc1020b..4233dc80988bdec1c1886dea58cd3bcef257fd33 100644 --- a/src/wayland/meta-xwayland.c +++ b/src/wayland/meta-xwayland.c @@ -647,6 +647,20 @@ xwayland_surface_get_toplevel (MetaWaylandSurfaceRole *surface_role) return meta_wayland_surface_role_get_surface (surface_role); } +static void +xwayland_surface_sync_actor_state (MetaWaylandActorSurface *actor_surface) +{ + MetaWaylandSurfaceRole *surface_role = + META_WAYLAND_SURFACE_ROLE (actor_surface); + MetaWaylandSurface *surface = + meta_wayland_surface_role_get_surface (surface_role); + MetaWaylandActorSurfaceClass *actor_surface_class = + META_WAYLAND_ACTOR_SURFACE_CLASS (meta_wayland_surface_role_xwayland_parent_class); + + if (surface->window) + actor_surface_class->sync_actor_state (actor_surface); +} + static void meta_wayland_surface_role_xwayland_init (MetaWaylandSurfaceRoleXWayland *role) { @@ -657,11 +671,15 @@ meta_wayland_surface_role_xwayland_class_init (MetaWaylandSurfaceRoleXWaylandCla { MetaWaylandSurfaceRoleClass *surface_role_class = META_WAYLAND_SURFACE_ROLE_CLASS (klass); + MetaWaylandActorSurfaceClass *actor_surface_class = + META_WAYLAND_ACTOR_SURFACE_CLASS (klass); surface_role_class->assigned = xwayland_surface_assigned; surface_role_class->commit = xwayland_surface_commit; surface_role_class->get_toplevel = xwayland_surface_get_toplevel; + actor_surface_class->sync_actor_state = xwayland_surface_sync_actor_state; + xwayland_surface_signals[XWAYLAND_SURFACE_WINDOW_ASSOCIATED] = g_signal_new ("window-associated", G_TYPE_FROM_CLASS (klass),