diff options
author | emersion <contact@emersion.fr> | 2017-10-06 16:51:16 +0200 |
---|---|---|
committer | emersion <contact@emersion.fr> | 2017-10-06 16:51:16 +0200 |
commit | fbca2809496bf68b6c3e50957c5c9b9a62813943 (patch) | |
tree | 0608332c5945460444f19bd7bf1b2bb3a8e9c6c6 | |
parent | b21f783c34f145545b0109b06b135cd1e9fa8b70 (diff) |
Unset input->active_view when view is destroyed
-rw-r--r-- | rootston/desktop.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/rootston/desktop.c b/rootston/desktop.c index d214e280..691d5809 100644 --- a/rootston/desktop.c +++ b/rootston/desktop.c @@ -16,6 +16,16 @@ void view_destroy(struct roots_view *view) { struct roots_desktop *desktop = view->desktop; + + struct roots_input *input = desktop->server->input; + if (input->active_view == view) { + input->active_view = NULL; + input->mode = ROOTS_CURSOR_PASSTHROUGH; + } + if (input->last_active_view == view) { + input->last_active_view = NULL; + } + for (size_t i = 0; i < desktop->views->length; ++i) { struct roots_view *_view = desktop->views->items[i]; if (view == _view) { |