summaryrefslogtreecommitdiff
path: root/libweston-desktop
diff options
context:
space:
mode:
authorPekka Paalanen <pekka.paalanen@collabora.co.uk>2016-11-15 14:24:21 +0200
committerPekka Paalanen <pekka.paalanen@collabora.co.uk>2016-11-25 13:13:43 +0200
commite3a582f9ff042cb252b474fcaf7030d3170d4bcb (patch)
tree635561a9895116814e3c23e83653014b48b7132d /libweston-desktop
parentbbc749af73431435a8f16e054f8fa1f2c902383a (diff)
libweston-desktop/xwayland: add is_mapped handling for XWAYLAND
The xwayland window type XWAYLAND is not handled by the shell at all, instead libweston-desktop maps such surfaces itself. However, it forgot to set weston_surface::is_mapped and weston_view::is_mapped. weston_surface::is_mapped affects the behaviour of weston_view_unmap() and weston_surface_attach(). weston_view::is_mapped affects the behaviour of weston_view_unmap() and weston_view_destroy(). When manually mapping a window of type XWAYLAND, mark both the view and surface as mapped. This follows the expections in libweston, even though the meaning of is_mapped is not clearly defined for either surface or view. Also, when the XWAYLAND window is manually unmapped, unmap the weston_surface. This updates weston_surface::is_mapped to reflect the state. However, as a side-effect it will also unmap all sibling views, should any exist. v2: rename surface_base to wsurface Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net> Acked-by: Daniel Stone <daniels@collabora.com>
Diffstat (limited to 'libweston-desktop')
-rw-r--r--libweston-desktop/xwayland.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libweston-desktop/xwayland.c b/libweston-desktop/xwayland.c
index 41bc4c89..baacf7b9 100644
--- a/libweston-desktop/xwayland.c
+++ b/libweston-desktop/xwayland.c
@@ -71,6 +71,7 @@ weston_desktop_xwayland_surface_change_state(struct weston_desktop_xwayland_surf
struct weston_desktop_surface *parent,
int32_t x, int32_t y)
{
+ struct weston_surface *wsurface;
bool to_add = (parent == NULL && state != XWAYLAND);
assert(state != NONE);
@@ -81,6 +82,8 @@ weston_desktop_xwayland_surface_change_state(struct weston_desktop_xwayland_surf
return;
}
+ wsurface = weston_desktop_surface_get_surface(surface->surface);
+
if (surface->state != state) {
if (surface->state == XWAYLAND) {
assert(!surface->added);
@@ -88,6 +91,7 @@ weston_desktop_xwayland_surface_change_state(struct weston_desktop_xwayland_surf
weston_desktop_surface_unlink_view(surface->view);
weston_view_destroy(surface->view);
surface->view = NULL;
+ weston_surface_unmap(wsurface);
}
if (to_add) {
@@ -109,6 +113,8 @@ weston_desktop_xwayland_surface_change_state(struct weston_desktop_xwayland_surf
weston_layer_entry_insert(&surface->xwayland->layer.view_list,
&surface->view->layer_link);
weston_view_set_position(surface->view, x, y);
+ surface->view->is_mapped = true;
+ wsurface->is_mapped = true;
}
surface->state = state;