From 52ff89cecc817c34b61f31c344f03137279c2e3d Mon Sep 17 00:00:00 2001 From: progandy Date: Sun, 28 Feb 2016 20:12:07 +0100 Subject: [PATCH 1/2] sway: set lock view to floating after ws switch This avoids calling swayc_active_workspace. --- sway/extensions.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/sway/extensions.c b/sway/extensions.c index 9596905cb..eee3a1d86 100644 --- a/sway/extensions.c +++ b/sway/extensions.c @@ -108,19 +108,17 @@ static void set_lock_surface(struct wl_client *client, struct wl_resource *resou swayc_t *view = swayc_by_handle(wlc_handle_from_wl_surface_resource(surface)); sway_log(L_DEBUG, "Setting lock surface to %p", view); if (view && output) { + swayc_t *workspace = output->focused; + if (!swayc_is_child_of(view, workspace)) { + move_container_to(view, workspace); + } // make the view floating so it doesn't rearrange other // siblings. if (!view->is_floating) { // Remove view from its current location destroy_container(remove_child(view)); - // and move it into workspace floating - add_floating(swayc_active_workspace(), view); - } - - swayc_t *workspace = output->focused; - if (!swayc_is_child_of(view, workspace)) { - move_container_to(view, workspace); + add_floating(workspace, view); } wlc_view_set_state(view->handle, WLC_BIT_FULLSCREEN, true); workspace->fullscreen = view; From 33887e3955c9a34c4edc115e952cca56891b089c Mon Sep 17 00:00:00 2001 From: progandy Date: Sun, 28 Feb 2016 21:24:12 +0100 Subject: [PATCH 2/2] sway: rearrange the whole ws on lock view setup --- sway/extensions.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sway/extensions.c b/sway/extensions.c index eee3a1d86..bd2792765 100644 --- a/sway/extensions.c +++ b/sway/extensions.c @@ -124,7 +124,7 @@ static void set_lock_surface(struct wl_client *client, struct wl_resource *resou workspace->fullscreen = view; desktop_shell.is_locked = true; set_focused_container(view); - arrange_windows(view, -1, -1); + arrange_windows(workspace, -1, -1); list_add(desktop_shell.lock_surfaces, surface); wl_resource_set_destructor(surface, lock_surface_destructor); } else {