mirror of
https://github.com/labwc/labwc.git
synced 2026-03-17 05:33:47 -04:00
xwayland: sync always-on-top to X11
This commit is contained in:
parent
3b6fe26301
commit
17d6c29037
2 changed files with 20 additions and 0 deletions
|
|
@ -59,6 +59,12 @@ struct xwayland_view {
|
|||
/* Not (yet) implemented */
|
||||
/* struct wl_listener set_role; */
|
||||
/* struct wl_listener set_hints; */
|
||||
|
||||
/* Events coming in from the view itself */
|
||||
struct {
|
||||
struct wl_listener always_on_top;
|
||||
} on_view;
|
||||
|
||||
};
|
||||
|
||||
void xwayland_unmanaged_create(struct server *server,
|
||||
|
|
|
|||
|
|
@ -368,6 +368,8 @@ handle_destroy(struct wl_listener *listener, void *data)
|
|||
wl_list_remove(&xwayland_view->focus_in.link);
|
||||
wl_list_remove(&xwayland_view->map_request.link);
|
||||
|
||||
wl_list_remove(&xwayland_view->on_view.always_on_top.link);
|
||||
|
||||
view_destroy(view);
|
||||
}
|
||||
|
||||
|
|
@ -1032,6 +1034,15 @@ static const struct view_impl xwayland_view_impl = {
|
|||
.get_pid = xwayland_view_get_pid,
|
||||
};
|
||||
|
||||
static void
|
||||
handle_always_on_top(struct wl_listener *listener, void *data)
|
||||
{
|
||||
struct xwayland_view *xwayland_view =
|
||||
wl_container_of(listener, xwayland_view, on_view.always_on_top);
|
||||
wlr_xwayland_surface_set_above(xwayland_view->xwayland_surface,
|
||||
xwayland_view->base.layer == VIEW_LAYER_ALWAYS_ON_TOP);
|
||||
}
|
||||
|
||||
void
|
||||
xwayland_view_create(struct server *server,
|
||||
struct wlr_xwayland_surface *xsurface, bool mapped)
|
||||
|
|
@ -1083,6 +1094,9 @@ xwayland_view_create(struct server *server,
|
|||
CONNECT_SIGNAL(xsurface, xwayland_view, focus_in);
|
||||
CONNECT_SIGNAL(xsurface, xwayland_view, map_request);
|
||||
|
||||
/* Events from the view itself */
|
||||
CONNECT_SIGNAL(view, &xwayland_view->on_view, always_on_top);
|
||||
|
||||
wl_list_insert(&view->server->views, &view->link);
|
||||
view->creation_id = view->server->next_view_creation_id++;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue