summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Drew DeVault <sir@cmpwn.com>2016-02-28 15:42:23 -0500
committerLibravatar Drew DeVault <sir@cmpwn.com>2016-02-28 15:42:23 -0500
commitcc170e1b2d403363b001e8382dc542e941406b66 (patch)
tree90b0685ec554e95f2eab5cc451e473be3c5b67c0
parentMerge pull request #496 from mikkeloscar/focus-new-output (diff)
parentsway: rearrange the whole ws on lock view setup (diff)
downloadsway-cc170e1b2d403363b001e8382dc542e941406b66.tar.gz
sway-cc170e1b2d403363b001e8382dc542e941406b66.tar.zst
sway-cc170e1b2d403363b001e8382dc542e941406b66.zip
Merge pull request #497 from progandy/swaylock-arrange
swaylock: call arrange_windows for floating change
-rw-r--r--sway/extensions.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/sway/extensions.c b/sway/extensions.c
index 9596905c..bd279276 100644
--- a/sway/extensions.c
+++ b/sway/extensions.c
@@ -108,25 +108,23 @@ 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;
127 desktop_shell.is_locked = true; 125 desktop_shell.is_locked = true;
128 set_focused_container(view); 126 set_focused_container(view);
129 arrange_windows(view, -1, -1); 127 arrange_windows(workspace, -1, -1);
130 list_add(desktop_shell.lock_surfaces, surface); 128 list_add(desktop_shell.lock_surfaces, surface);
131 wl_resource_set_destructor(surface, lock_surface_destructor); 129 wl_resource_set_destructor(surface, lock_surface_destructor);
132 } else { 130 } else {