|
|
c80064 |
From 9269b09028ae51c7bb74e9cc9aefafd8eaa882d6 Mon Sep 17 00:00:00 2001
|
|
|
c80064 |
From: Robert Mader <robert.mader@posteo.de>
|
|
|
c80064 |
Date: Tue, 16 Apr 2019 23:35:28 +0200
|
|
|
c80064 |
Subject: [PATCH 1/2] wayland: Move check for present window out of the
|
|
|
c80064 |
actor-surface class
|
|
|
c80064 |
|
|
|
c80064 |
All child classes of `MetaWaylandShellSurface` as well as
|
|
|
c80064 |
`MetaWaylandSurfaceRoleXWayland` should only sync their actor if
|
|
|
c80064 |
their toplevel surface has a window. Currently this check is done
|
|
|
c80064 |
in the actor-surface class, but not all surface classes have a
|
|
|
c80064 |
toplevel window, e.g. dnd-surfaces.
|
|
|
c80064 |
Move the check to the right places.
|
|
|
c80064 |
|
|
|
c80064 |
For subsurfaces this assumes that the subsurface is not the child of
|
|
|
c80064 |
a window-less surface (like, as stated above, e.g. a dnd-surface).
|
|
|
c80064 |
If we want to support subsurfaces of window-less surfaces in the future
|
|
|
c80064 |
we have to extend the check here.
|
|
|
c80064 |
But as this is not a regression, ignore this case for now.
|
|
|
c80064 |
|
|
|
c80064 |
https://gitlab.gnome.org/GNOME/mutter/merge_requests/537
|
|
|
c80064 |
(cherry picked from commit 7e2a0ede16bed5671fe55d3d81ccc9f82eebd94b)
|
|
|
c80064 |
---
|
|
|
c80064 |
src/wayland/meta-wayland-actor-surface.c | 7 -------
|
|
|
c80064 |
src/wayland/meta-wayland-shell-surface.c | 20 ++++++++++++++++++++
|
|
|
c80064 |
src/wayland/meta-wayland-subsurface.c | 5 ++++-
|
|
|
c80064 |
src/wayland/meta-xwayland.c | 18 ++++++++++++++++++
|
|
|
c80064 |
4 files changed, 42 insertions(+), 8 deletions(-)
|
|
|
c80064 |
|
|
|
c80064 |
diff --git a/src/wayland/meta-wayland-actor-surface.c b/src/wayland/meta-wayland-actor-surface.c
|
|
|
c80064 |
index 037dd901ab..e2143e51f1 100644
|
|
|
c80064 |
--- a/src/wayland/meta-wayland-actor-surface.c
|
|
|
c80064 |
+++ b/src/wayland/meta-wayland-actor-surface.c
|
|
|
c80064 |
@@ -295,9 +295,6 @@ meta_wayland_actor_surface_commit (MetaWaylandSurfaceRole *surface_role,
|
|
|
c80064 |
META_WAYLAND_ACTOR_SURFACE (surface_role);
|
|
|
c80064 |
MetaWaylandActorSurfacePrivate *priv =
|
|
|
c80064 |
meta_wayland_actor_surface_get_instance_private (actor_surface);
|
|
|
c80064 |
- MetaWaylandSurface *surface =
|
|
|
c80064 |
- meta_wayland_surface_role_get_surface (surface_role);
|
|
|
c80064 |
- MetaWaylandSurface *toplevel_surface;
|
|
|
c80064 |
|
|
|
c80064 |
if (!wl_list_empty (&pending->frame_callback_list) &&
|
|
|
c80064 |
priv->actor &&
|
|
|
c80064 |
@@ -311,10 +308,6 @@ meta_wayland_actor_surface_commit (MetaWaylandSurfaceRole *surface_role,
|
|
|
c80064 |
|
|
|
c80064 |
meta_wayland_actor_surface_queue_frame_callbacks (actor_surface, pending);
|
|
|
c80064 |
|
|
|
c80064 |
- toplevel_surface = meta_wayland_surface_get_toplevel (surface);
|
|
|
c80064 |
- if (!toplevel_surface || !toplevel_surface->window)
|
|
|
c80064 |
- return;
|
|
|
c80064 |
-
|
|
|
c80064 |
meta_wayland_actor_surface_sync_actor_state (actor_surface);
|
|
|
c80064 |
}
|
|
|
c80064 |
|
|
|
c80064 |
diff --git a/src/wayland/meta-wayland-shell-surface.c b/src/wayland/meta-wayland-shell-surface.c
|
|
|
c80064 |
index 04f2aaeea8..f8354ab7c5 100644
|
|
|
c80064 |
--- a/src/wayland/meta-wayland-shell-surface.c
|
|
|
c80064 |
+++ b/src/wayland/meta-wayland-shell-surface.c
|
|
|
c80064 |
@@ -175,6 +175,22 @@ meta_wayland_shell_surface_surface_commit (MetaWaylandSurfaceRole *surface_role
|
|
|
c80064 |
window->buffer_rect.height = cogl_texture_get_height (texture) * scale;
|
|
|
c80064 |
}
|
|
|
c80064 |
|
|
|
c80064 |
+static void
|
|
|
c80064 |
+meta_wayland_shell_surface_sync_actor_state (MetaWaylandActorSurface *actor_surface)
|
|
|
c80064 |
+{
|
|
|
c80064 |
+ MetaWaylandSurfaceRole *surface_role =
|
|
|
c80064 |
+ META_WAYLAND_SURFACE_ROLE (actor_surface);
|
|
|
c80064 |
+ MetaWaylandSurface *surface =
|
|
|
c80064 |
+ meta_wayland_surface_role_get_surface (surface_role);
|
|
|
c80064 |
+ MetaWaylandActorSurfaceClass *actor_surface_class =
|
|
|
c80064 |
+ META_WAYLAND_ACTOR_SURFACE_CLASS (meta_wayland_shell_surface_parent_class);
|
|
|
c80064 |
+ MetaWaylandSurface *toplevel_surface;
|
|
|
c80064 |
+
|
|
|
c80064 |
+ toplevel_surface = meta_wayland_surface_get_toplevel (surface);
|
|
|
c80064 |
+ if (toplevel_surface && toplevel_surface->window)
|
|
|
c80064 |
+ actor_surface_class->sync_actor_state (actor_surface);
|
|
|
c80064 |
+}
|
|
|
c80064 |
+
|
|
|
c80064 |
static void
|
|
|
c80064 |
meta_wayland_shell_surface_init (MetaWaylandShellSurface *role)
|
|
|
c80064 |
{
|
|
|
c80064 |
@@ -185,6 +201,10 @@ meta_wayland_shell_surface_class_init (MetaWaylandShellSurfaceClass *klass)
|
|
|
c80064 |
{
|
|
|
c80064 |
MetaWaylandSurfaceRoleClass *surface_role_class =
|
|
|
c80064 |
META_WAYLAND_SURFACE_ROLE_CLASS (klass);
|
|
|
c80064 |
+ MetaWaylandActorSurfaceClass *actor_surface_class =
|
|
|
c80064 |
+ META_WAYLAND_ACTOR_SURFACE_CLASS (klass);
|
|
|
c80064 |
|
|
|
c80064 |
surface_role_class->commit = meta_wayland_shell_surface_surface_commit;
|
|
|
c80064 |
+ actor_surface_class->sync_actor_state =
|
|
|
c80064 |
+ meta_wayland_shell_surface_sync_actor_state;
|
|
|
c80064 |
}
|
|
|
c80064 |
diff --git a/src/wayland/meta-wayland-subsurface.c b/src/wayland/meta-wayland-subsurface.c
|
|
|
c80064 |
index c7059b99a2..9a7ff3ec12 100644
|
|
|
c80064 |
--- a/src/wayland/meta-wayland-subsurface.c
|
|
|
c80064 |
+++ b/src/wayland/meta-wayland-subsurface.c
|
|
|
c80064 |
@@ -199,8 +199,11 @@ meta_wayland_subsurface_sync_actor_state (MetaWaylandActorSurface *actor_surface
|
|
|
c80064 |
meta_wayland_surface_role_get_surface (surface_role);
|
|
|
c80064 |
MetaWaylandActorSurfaceClass *actor_surface_class =
|
|
|
c80064 |
META_WAYLAND_ACTOR_SURFACE_CLASS (meta_wayland_subsurface_parent_class);
|
|
|
c80064 |
+ MetaWaylandSurface *toplevel_surface;
|
|
|
c80064 |
|
|
|
c80064 |
- actor_surface_class->sync_actor_state (actor_surface);
|
|
|
c80064 |
+ toplevel_surface = meta_wayland_surface_get_toplevel (surface);
|
|
|
c80064 |
+ if (toplevel_surface && toplevel_surface->window)
|
|
|
c80064 |
+ actor_surface_class->sync_actor_state (actor_surface);
|
|
|
c80064 |
|
|
|
c80064 |
sync_actor_subsurface_state (surface);
|
|
|
c80064 |
}
|
|
|
c80064 |
diff --git a/src/wayland/meta-xwayland.c b/src/wayland/meta-xwayland.c
|
|
|
c80064 |
index 6e4b9a8ffd..b71c638d93 100644
|
|
|
c80064 |
--- a/src/wayland/meta-xwayland.c
|
|
|
c80064 |
+++ b/src/wayland/meta-xwayland.c
|
|
|
c80064 |
@@ -794,6 +794,20 @@ xwayland_surface_get_toplevel (MetaWaylandSurfaceRole *surface_role)
|
|
|
c80064 |
return meta_wayland_surface_role_get_surface (surface_role);
|
|
|
c80064 |
}
|
|
|
c80064 |
|
|
|
c80064 |
+static void
|
|
|
c80064 |
+xwayland_surface_sync_actor_state (MetaWaylandActorSurface *actor_surface)
|
|
|
c80064 |
+{
|
|
|
c80064 |
+ MetaWaylandSurfaceRole *surface_role =
|
|
|
c80064 |
+ META_WAYLAND_SURFACE_ROLE (actor_surface);
|
|
|
c80064 |
+ MetaWaylandSurface *surface =
|
|
|
c80064 |
+ meta_wayland_surface_role_get_surface (surface_role);
|
|
|
c80064 |
+ MetaWaylandActorSurfaceClass *actor_surface_class =
|
|
|
c80064 |
+ META_WAYLAND_ACTOR_SURFACE_CLASS (meta_wayland_surface_role_xwayland_parent_class);
|
|
|
c80064 |
+
|
|
|
c80064 |
+ if (surface->window)
|
|
|
c80064 |
+ actor_surface_class->sync_actor_state (actor_surface);
|
|
|
c80064 |
+}
|
|
|
c80064 |
+
|
|
|
c80064 |
static void
|
|
|
c80064 |
meta_wayland_surface_role_xwayland_init (MetaWaylandSurfaceRoleXWayland *role)
|
|
|
c80064 |
{
|
|
|
c80064 |
@@ -804,9 +818,13 @@ meta_wayland_surface_role_xwayland_class_init (MetaWaylandSurfaceRoleXWaylandCla
|
|
|
c80064 |
{
|
|
|
c80064 |
MetaWaylandSurfaceRoleClass *surface_role_class =
|
|
|
c80064 |
META_WAYLAND_SURFACE_ROLE_CLASS (klass);
|
|
|
c80064 |
+ MetaWaylandActorSurfaceClass *actor_surface_class =
|
|
|
c80064 |
+ META_WAYLAND_ACTOR_SURFACE_CLASS (klass);
|
|
|
c80064 |
|
|
|
c80064 |
surface_role_class->get_toplevel = xwayland_surface_get_toplevel;
|
|
|
c80064 |
|
|
|
c80064 |
+ actor_surface_class->sync_actor_state = xwayland_surface_sync_actor_state;
|
|
|
c80064 |
+
|
|
|
c80064 |
xwayland_surface_signals[XWAYLAND_SURFACE_WINDOW_ASSOCIATED] =
|
|
|
c80064 |
g_signal_new ("window-associated",
|
|
|
c80064 |
G_TYPE_FROM_CLASS (klass),
|
|
|
c80064 |
--
|
|
|
c80064 |
2.31.1
|
|
|
c80064 |
|