Unset input->active_view when view is destroyed

master
emersion 7 years ago
parent b21f783c34
commit fbca280949
No known key found for this signature in database
GPG Key ID: 0FDE7BE0E88F5E48

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

Loading…
Cancel
Save