diff options
author | progandy <code@progandy> | 2016-02-28 20:12:07 +0100 |
---|---|---|
committer | progandy <code@progandy> | 2016-02-28 21:22:57 +0100 |
commit | 52ff89cecc817c34b61f31c344f03137279c2e3d (patch) | |
tree | a54535f1534ddc228b8e4748bf6af2e4545fd2e7 /sway | |
parent | 86b894d804e238ba59ceccf51bda114e224076b8 (diff) | |
download | sway-52ff89cecc817c34b61f31c344f03137279c2e3d.tar.xz |
sway: set lock view to floating after ws switch
This avoids calling swayc_active_workspace.
Diffstat (limited to 'sway')
-rw-r--r-- | sway/extensions.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/sway/extensions.c b/sway/extensions.c index 9596905c..eee3a1d8 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; |