mirror of
https://github.com/swaywm/sway.git
synced 2024-11-25 17:31:28 +00:00
Merge pull request #938 from alkino/fix_sibling
Fix creating of sibling floating/children
This commit is contained in:
parent
f1c5ba0a10
commit
59babac69d
|
@ -99,12 +99,21 @@ void add_floating(swayc_t *ws, swayc_t *child) {
|
||||||
|
|
||||||
swayc_t *add_sibling(swayc_t *fixed, swayc_t *active) {
|
swayc_t *add_sibling(swayc_t *fixed, swayc_t *active) {
|
||||||
swayc_t *parent = fixed->parent;
|
swayc_t *parent = fixed->parent;
|
||||||
int i = index_child(fixed);
|
|
||||||
if (fixed->is_floating) {
|
if (fixed->is_floating) {
|
||||||
|
if (active->is_floating) {
|
||||||
|
int i = index_child(fixed);
|
||||||
list_insert(parent->floating, i + 1, active);
|
list_insert(parent->floating, i + 1, active);
|
||||||
} else {
|
} else {
|
||||||
|
list_add(parent->children, active);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (active->is_floating) {
|
||||||
|
list_add(parent->floating, active);
|
||||||
|
} else {
|
||||||
|
int i = index_child(fixed);
|
||||||
list_insert(parent->children, i + 1, active);
|
list_insert(parent->children, i + 1, active);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
active->parent = parent;
|
active->parent = parent;
|
||||||
// focus new child
|
// focus new child
|
||||||
parent->focused = active;
|
parent->focused = active;
|
||||||
|
|
Loading…
Reference in a new issue