From fbca2809496bf68b6c3e50957c5c9b9a62813943 Mon Sep 17 00:00:00 2001 From: emersion Date: Fri, 6 Oct 2017 16:51:16 +0200 Subject: [PATCH] Unset input->active_view when view is destroyed --- rootston/desktop.c | 10 ++++++++++ 1 file changed, 10 insertions(+) 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) {