diff options
author | Drew DeVault <sir@cmpwn.com> | 2015-08-09 12:06:46 -0400 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2015-08-09 12:06:46 -0400 |
commit | bab080cea3d28dad387760d93db55cc711980d9a (patch) | |
tree | 38ff188dbe199c4e45af3b6bb4c95ff6c768e466 | |
parent | f97a48d5b75fd80a578af14f19d0b1d954f82fdd (diff) | |
download | sway-bab080cea3d28dad387760d93db55cc711980d9a.tar.xz |
Fix up some issues with focus
-rw-r--r-- | sway/handlers.c | 3 | ||||
-rw-r--r-- | sway/layout.c | 6 |
2 files changed, 6 insertions, 3 deletions
diff --git a/sway/handlers.c b/sway/handlers.c index 0c0fb85f..70d044b6 100644 --- a/sway/handlers.c +++ b/sway/handlers.c @@ -39,8 +39,7 @@ void handle_view_destroyed(wlc_handle view) { } void handle_view_focus(wlc_handle view, bool focus) { - wlc_view_set_state(view, WLC_BIT_ACTIVATED, focus); - focus_view(get_swayc_for_handle(view, &root_container)); + return; } void handle_view_geometry_request(wlc_handle view, const struct wlc_geometry* geometry) { 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 { |