Unset input->active_view when view is destroyed

This commit is contained in:
emersion 2017-10-06 16:51:16 +02:00
parent b21f783c34
commit fbca280949
No known key found for this signature in database
GPG key ID: 0FDE7BE0E88F5E48

View file

@ -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) {