xwayland: only restack windows when activating them

This commit is contained in:
novenary 2023-03-02 16:51:41 +02:00
parent 3bc164216f
commit 7669241754

View file

@ -277,7 +277,9 @@ static void set_activated(struct sway_view *view, bool activated) {
} }
wlr_xwayland_surface_activate(surface, activated); wlr_xwayland_surface_activate(surface, activated);
if (activated) {
wlr_xwayland_surface_restack(surface, NULL, XCB_STACK_MODE_ABOVE); wlr_xwayland_surface_restack(surface, NULL, XCB_STACK_MODE_ABOVE);
}
struct sway_xwayland_unmanaged *unmanaged; struct sway_xwayland_unmanaged *unmanaged;
wl_list_for_each(unmanaged, &root->xwayland_unmanaged, link) { wl_list_for_each(unmanaged, &root->xwayland_unmanaged, link) {
@ -285,8 +287,10 @@ static void set_activated(struct sway_view *view, bool activated) {
if (!is_surface_transient_for(unmanaged_surface, view)) { if (!is_surface_transient_for(unmanaged_surface, view)) {
continue; continue;
} }
if (activated) {
wlr_xwayland_surface_restack(unmanaged_surface, NULL, XCB_STACK_MODE_ABOVE); wlr_xwayland_surface_restack(unmanaged_surface, NULL, XCB_STACK_MODE_ABOVE);
} }
}
} }
static void set_tiled(struct sway_view *view, bool tiled) { static void set_tiled(struct sway_view *view, bool tiled) {