aboutsummaryrefslogtreecommitdiff
path: root/rootston/desktop.c
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2017-10-06 16:51:16 +0200
committeremersion <contact@emersion.fr>2017-10-06 16:51:16 +0200
commitfbca2809496bf68b6c3e50957c5c9b9a62813943 (patch)
tree0608332c5945460444f19bd7bf1b2bb3a8e9c6c6 /rootston/desktop.c
parentb21f783c34f145545b0109b06b135cd1e9fa8b70 (diff)
Unset input->active_view when view is destroyed
Diffstat (limited to 'rootston/desktop.c')
-rw-r--r--rootston/desktop.c10
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) {