diff options
author | Marius Vlad <marius.vlad@collabora.com> | 2023-07-21 15:37:49 +0300 |
---|---|---|
committer | Marius Vlad <marius.vlad@collabora.com> | 2023-07-24 15:31:57 +0300 |
commit | 26700fa20abefccb77bb586b49b1629bf102e131 (patch) | |
tree | 47bc5e076e78066efc78230abc308206f3e937e7 | |
parent | 8033c46081b93f19843d140e58b527af7abf7a4f (diff) |
layout: Determine xwayland surface in a generic fashion
This provides a far better way of determining if the surface is
xwayland or not. We can then make sure all X11 clients can be displayed.
Bug-AGL: SPEC-4847
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: I2140c452c0d37a84323eaf75787eb32a7771a56e
-rw-r--r-- | src/desktop.c | 16 | ||||
-rw-r--r-- | src/ivi-compositor.h | 3 | ||||
-rw-r--r-- | src/layout.c | 11 |
3 files changed, 26 insertions, 4 deletions
diff --git a/src/desktop.c b/src/desktop.c index 9f472c0..0186e9f 100644 --- a/src/desktop.c +++ b/src/desktop.c @@ -582,6 +582,22 @@ transform_handler(struct wl_listener *listener, void *data) api->send_position(surface, x, y); } +bool +is_shell_surface_xwayland(struct ivi_surface *surf) +{ + const struct weston_xwayland_surface_api *api; + struct ivi_compositor *ivi = surf->ivi; + struct weston_surface *surface; + + api = ivi->xwayland_surface_api; + + if (!api) + return false; + + surface = weston_desktop_surface_get_surface(surf->dsurface); + return api->is_xwayland_surface(surface); +} + int ivi_desktop_init(struct ivi_compositor *ivi) { diff --git a/src/ivi-compositor.h b/src/ivi-compositor.h index c5d9fc3..6b6204e 100644 --- a/src/ivi-compositor.h +++ b/src/ivi-compositor.h @@ -518,4 +518,7 @@ ivi_surface_count_one(struct ivi_output *ivi_output, int parse_activation_area(const char *geometry, struct ivi_output *output); +bool +is_shell_surface_xwayland(struct ivi_surface *surf); + #endif diff --git a/src/layout.c b/src/layout.c index 89c2097..5576094 100644 --- a/src/layout.c +++ b/src/layout.c @@ -581,9 +581,12 @@ ivi_layout_desktop_committed(struct ivi_surface *surf) return; } - if (!surf->ivi->activate_by_default && !surf->xwayland.is_set) { - weston_log("Refusing to activate surface role %d, app_id %s\n", - surf->role, app_id); + if (!surf->ivi->activate_by_default && + (!surf->xwayland.is_set && !is_shell_surface_xwayland(surf))) { + weston_log("Refusing to activate surface role %d, app_id %s, type %s\n", + surf->role, app_id, + is_shell_surface_xwayland(surf) ? + "xwayland" : "regular"); if (!weston_desktop_surface_get_maximized(dsurf) || geom.width != r_output->area.width || @@ -611,7 +614,7 @@ ivi_layout_desktop_committed(struct ivi_surface *surf) */ weston_log("Surface no app_id, role %s activating by default\n", ivi_layout_get_surface_role_name(surf)); - if (surf->xwayland.is_set) { + if (surf->xwayland.is_set || is_shell_surface_xwayland(surf)) { ivi_layout_activate_by_surf(r_output, surf); ivi_layout_activate_complete(r_output, surf); } else { |