mirror of
https://github.com/swaywm/sway.git
synced 2025-11-11 13:29:51 -05:00
more changes
This commit is contained in:
parent
4606fb1ee3
commit
63bc0d3b54
5 changed files with 19 additions and 13 deletions
|
|
@ -60,8 +60,9 @@ swayc_t *replace_child(swayc_t *child, swayc_t *new_child) {
|
|||
return parent;
|
||||
}
|
||||
|
||||
swayc_t *remove_child(swayc_t *parent, swayc_t *child) {
|
||||
swayc_t *remove_child(swayc_t *child) {
|
||||
int i;
|
||||
swayc_t *parent = child->parent;
|
||||
// Special case for floating views
|
||||
if (child->is_floating) {
|
||||
for (i = 0; i < parent->floating->length; ++i) {
|
||||
|
|
@ -79,7 +80,11 @@ swayc_t *remove_child(swayc_t *parent, swayc_t *child) {
|
|||
}
|
||||
}
|
||||
if (parent->focused == child) {
|
||||
parent->focused = NULL;
|
||||
if (parent->children->length > 0) {
|
||||
parent->focused = parent->children->items[i?i-1:0];
|
||||
} else {
|
||||
parent->focused = NULL;
|
||||
}
|
||||
}
|
||||
return parent;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue