diff options
author | Drew DeVault <sir@cmpwn.com> | 2017-10-06 11:13:37 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-06 11:13:37 -0400 |
commit | b351e0a95063114f8ff06c90c21d76cb9d26834e (patch) | |
tree | d6b2a838d1388bc404a1c5813d3fa3b84ab98daa /rootston/desktop.c | |
parent | 6aafc2f61a395cf72b204f487e74bd83965a41e6 (diff) | |
parent | f402598ee115e06a9d7595042495e9b061d7530a (diff) |
Merge pull request #224 from emersion/rootston-commands
Add command to close views
Diffstat (limited to 'rootston/desktop.c')
-rw-r--r-- | rootston/desktop.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/rootston/desktop.c b/rootston/desktop.c index f99afaf5..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) { @@ -58,6 +68,12 @@ void view_resize(struct roots_view *view, uint32_t width, uint32_t height) { } } +void view_close(struct roots_view *view) { + if (view->close) { + view->close(view); + } +} + static struct wlr_subsurface *subsurface_at(struct wlr_surface *surface, double sx, double sy, double *sub_x, double *sub_y) { struct wlr_subsurface *subsurface; |