diff --git a/include/xwayland.h b/include/xwayland.h index bbb9fa1c..322ca017 100644 --- a/include/xwayland.h +++ b/include/xwayland.h @@ -44,6 +44,7 @@ struct xwayland_view { /* Events unique to XWayland views */ struct wl_listener associate; struct wl_listener dissociate; + struct wl_listener request_above; struct wl_listener request_activate; struct wl_listener request_configure; struct wl_listener set_class; diff --git a/src/xwayland.c b/src/xwayland.c index 9bb1cf39..61bc93f9 100644 --- a/src/xwayland.c +++ b/src/xwayland.c @@ -355,6 +355,7 @@ handle_destroy(struct wl_listener *listener, void *data) /* Remove XWayland view specific listeners */ wl_list_remove(&xwayland_view->associate.link); wl_list_remove(&xwayland_view->dissociate.link); + wl_list_remove(&xwayland_view->request_above.link); wl_list_remove(&xwayland_view->request_activate.link); wl_list_remove(&xwayland_view->request_configure.link); wl_list_remove(&xwayland_view->set_class.link); @@ -422,6 +423,17 @@ handle_request_configure(struct wl_listener *listener, void *data) } } +static void +handle_request_above(struct wl_listener *listener, void *data) +{ + struct xwayland_view *xwayland_view = + wl_container_of(listener, xwayland_view, request_above); + struct view *view = &xwayland_view->base; + + view_set_layer(view, xwayland_view->xwayland_surface->above + ? VIEW_LAYER_ALWAYS_ON_TOP : VIEW_LAYER_NORMAL); +} + static void handle_request_activate(struct wl_listener *listener, void *data) { @@ -705,6 +717,8 @@ handle_map_request(struct wl_listener *listener, void *data) axis |= VIEW_AXIS_VERTICAL; } view_maximize(view, axis); + view_set_layer(view, xsurface->above + ? VIEW_LAYER_ALWAYS_ON_TOP : VIEW_LAYER_NORMAL); /* * We could also call set_initial_position() here, but it's not * really necessary until the view is actually mapped (and at @@ -1034,6 +1048,7 @@ xwayland_view_create(struct server *server, /* Events specific to XWayland views */ CONNECT_SIGNAL(xsurface, xwayland_view, associate); CONNECT_SIGNAL(xsurface, xwayland_view, dissociate); + CONNECT_SIGNAL(xsurface, xwayland_view, request_above); CONNECT_SIGNAL(xsurface, xwayland_view, request_activate); CONNECT_SIGNAL(xsurface, xwayland_view, request_configure); CONNECT_SIGNAL(xsurface, xwayland_view, set_class);