diff --git a/src/xwayland-unmanaged.c b/src/xwayland-unmanaged.c index 56befc90..ca78722d 100644 --- a/src/xwayland-unmanaged.c +++ b/src/xwayland-unmanaged.c @@ -32,6 +32,8 @@ unmanaged_handle_map(struct wl_listener *listener, void *data) wl_container_of(listener, unmanaged, map); struct wlr_xwayland_surface *xsurface = unmanaged->xwayland_surface; + /* Stack new surface on top */ + wlr_xwayland_surface_restack(xsurface, NULL, XCB_STACK_MODE_ABOVE); wl_list_insert(unmanaged->server->unmanaged_surfaces.prev, &unmanaged->link); diff --git a/src/xwayland.c b/src/xwayland.c index 41f51c78..ca4646dc 100644 --- a/src/xwayland.c +++ b/src/xwayland.c @@ -386,6 +386,13 @@ set_activated(struct view *view, bool activated) wlr_xwayland_surface_activate(surface, activated); if (activated) { wlr_xwayland_surface_restack(surface, NULL, XCB_STACK_MODE_ABOVE); + /* Restack unmanaged surfaces on top */ + struct xwayland_unmanaged *u; + struct wl_list *list = &view->server->unmanaged_surfaces; + wl_list_for_each (u, list, link) { + wlr_xwayland_surface_restack(u->xwayland_surface, NULL, + XCB_STACK_MODE_ABOVE); + } } }