mirror of
https://github.com/swaywm/sway.git
synced 2026-04-16 08:21:30 -04:00
Merge 1cfd53e047 into 909a2ddb5f
This commit is contained in:
commit
4893040498
1 changed files with 7 additions and 7 deletions
|
|
@ -1011,8 +1011,6 @@ void container_set_floating(struct sway_container *container, bool enable) {
|
|||
|
||||
struct sway_seat *seat = input_manager_current_seat();
|
||||
struct sway_workspace *workspace = container->pending.workspace;
|
||||
struct sway_container *focus = seat_get_focused_container(seat);
|
||||
bool set_focus = focus == container;
|
||||
|
||||
if (enable) {
|
||||
struct sway_container *old_parent = container->pending.parent;
|
||||
|
|
@ -1033,10 +1031,6 @@ void container_set_floating(struct sway_container *container, bool enable) {
|
|||
container_floating_set_default_size(container);
|
||||
container_floating_resize_and_center(container);
|
||||
if (old_parent) {
|
||||
if (set_focus) {
|
||||
seat_set_raw_focus(seat, &old_parent->node);
|
||||
seat_set_raw_focus(seat, &container->node);
|
||||
}
|
||||
container_reap_empty(old_parent);
|
||||
}
|
||||
} else {
|
||||
|
|
@ -1051,7 +1045,13 @@ void container_set_floating(struct sway_container *container, bool enable) {
|
|||
if (reference->view) {
|
||||
container_add_sibling(reference, container, 1);
|
||||
} else {
|
||||
container_add_child(reference, container);
|
||||
struct sway_container *sibling =
|
||||
seat_get_focus_inactive_view(seat, &reference->node);
|
||||
if (sibling) {
|
||||
container_add_sibling(sibling, container, 1);
|
||||
} else {
|
||||
container_add_child(reference, container);
|
||||
}
|
||||
}
|
||||
container->pending.width = reference->pending.width;
|
||||
container->pending.height = reference->pending.height;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue