From 972e9dbd1b2eb2853a60632d279bd754daf7c440 Mon Sep 17 00:00:00 2001 From: emersion Date: Fri, 6 Oct 2017 15:39:39 +0200 Subject: Add close command, add close for xwayland --- rootston/desktop.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'rootston/desktop.c') diff --git a/rootston/desktop.c b/rootston/desktop.c index f99afaf5..d214e280 100644 --- a/rootston/desktop.c +++ b/rootston/desktop.c @@ -58,6 +58,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; -- cgit v1.2.3 From fbca2809496bf68b6c3e50957c5c9b9a62813943 Mon Sep 17 00:00:00 2001 From: emersion Date: Fri, 6 Oct 2017 16:51:16 +0200 Subject: Unset input->active_view when view is destroyed --- rootston/desktop.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'rootston/desktop.c') 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) { -- cgit v1.2.3