mirror of
https://github.com/swaywm/sway.git
synced 2024-11-14 14:34:07 +01:00
Merge pull request #497 from progandy/swaylock-arrange
swaylock: call arrange_windows for floating change
This commit is contained in:
commit
cc170e1b2d
@ -108,25 +108,23 @@ 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));
|
swayc_t *view = swayc_by_handle(wlc_handle_from_wl_surface_resource(surface));
|
||||||
sway_log(L_DEBUG, "Setting lock surface to %p", view);
|
sway_log(L_DEBUG, "Setting lock surface to %p", view);
|
||||||
if (view && output) {
|
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
|
// make the view floating so it doesn't rearrange other
|
||||||
// siblings.
|
// siblings.
|
||||||
if (!view->is_floating) {
|
if (!view->is_floating) {
|
||||||
// Remove view from its current location
|
// Remove view from its current location
|
||||||
destroy_container(remove_child(view));
|
destroy_container(remove_child(view));
|
||||||
|
|
||||||
// and move it into workspace floating
|
// and move it into workspace floating
|
||||||
add_floating(swayc_active_workspace(), view);
|
add_floating(workspace, view);
|
||||||
}
|
|
||||||
|
|
||||||
swayc_t *workspace = output->focused;
|
|
||||||
if (!swayc_is_child_of(view, workspace)) {
|
|
||||||
move_container_to(view, workspace);
|
|
||||||
}
|
}
|
||||||
wlc_view_set_state(view->handle, WLC_BIT_FULLSCREEN, true);
|
wlc_view_set_state(view->handle, WLC_BIT_FULLSCREEN, true);
|
||||||
workspace->fullscreen = view;
|
workspace->fullscreen = view;
|
||||||
desktop_shell.is_locked = true;
|
desktop_shell.is_locked = true;
|
||||||
set_focused_container(view);
|
set_focused_container(view);
|
||||||
arrange_windows(view, -1, -1);
|
arrange_windows(workspace, -1, -1);
|
||||||
list_add(desktop_shell.lock_surfaces, surface);
|
list_add(desktop_shell.lock_surfaces, surface);
|
||||||
wl_resource_set_destructor(surface, lock_surface_destructor);
|
wl_resource_set_destructor(surface, lock_surface_destructor);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user