summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar progandy <code@progandy>2016-02-28 20:12:07 +0100
committerLibravatar progandy <code@progandy>2016-02-28 21:22:57 +0100
commit52ff89cecc817c34b61f31c344f03137279c2e3d (patch)
treea54535f1534ddc228b8e4748bf6af2e4545fd2e7
parentMerge pull request #496 from mikkeloscar/focus-new-output (diff)
downloadsway-52ff89cecc817c34b61f31c344f03137279c2e3d.tar.gz
sway-52ff89cecc817c34b61f31c344f03137279c2e3d.tar.zst
sway-52ff89cecc817c34b61f31c344f03137279c2e3d.zip
sway: set lock view to floating after ws switch
This avoids calling swayc_active_workspace.
-rw-r--r--sway/extensions.c12
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
108 swayc_t *view = swayc_by_handle(wlc_handle_from_wl_surface_resource(surface)); 108 swayc_t *view = swayc_by_handle(wlc_handle_from_wl_surface_resource(surface));
109 sway_log(L_DEBUG, "Setting lock surface to %p", view); 109 sway_log(L_DEBUG, "Setting lock surface to %p", view);
110 if (view && output) { 110 if (view && output) {
111 swayc_t *workspace = output->focused;
112 if (!swayc_is_child_of(view, workspace)) {
113 move_container_to(view, workspace);
114 }
111 // make the view floating so it doesn't rearrange other 115 // make the view floating so it doesn't rearrange other
112 // siblings. 116 // siblings.
113 if (!view->is_floating) { 117 if (!view->is_floating) {
114 // Remove view from its current location 118 // Remove view from its current location
115 destroy_container(remove_child(view)); 119 destroy_container(remove_child(view));
116
117 // and move it into workspace floating 120 // and move it into workspace floating
118 add_floating(swayc_active_workspace(), view); 121 add_floating(workspace, view);
119 }
120
121 swayc_t *workspace = output->focused;
122 if (!swayc_is_child_of(view, workspace)) {
123 move_container_to(view, workspace);
124 } 122 }
125 wlc_view_set_state(view->handle, WLC_BIT_FULLSCREEN, true); 123 wlc_view_set_state(view->handle, WLC_BIT_FULLSCREEN, true);
126 workspace->fullscreen = view; 124 workspace->fullscreen = view;