aboutsummaryrefslogtreecommitdiff
path: root/sway/layout.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/layout.c')
-rw-r--r--sway/layout.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sway/layout.c b/sway/layout.c
index 996be387..68d7cf7e 100644
--- a/sway/layout.c
+++ b/sway/layout.c
@@ -161,7 +161,7 @@ void add_view(wlc_handle view_handle) {
view->type = C_VIEW;
add_child(parent, view);
- wlc_view_focus(view_handle);
+ focus_view(view);
arrange_windows(parent, -1, -1);
}
@@ -187,6 +187,10 @@ void destroy_view(swayc_t *view) {
free_swayc(view);
+ if (parent->focused == view) {
+ parent->focused = NULL;
+ }
+
if (parent->children->length != 0) {
focus_view(parent->children->items[0]);
} else {