aboutsummaryrefslogtreecommitdiff
path: root/rootston/wl_shell.c
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2017-10-06 11:13:37 -0400
committerGitHub <noreply@github.com>2017-10-06 11:13:37 -0400
commitb351e0a95063114f8ff06c90c21d76cb9d26834e (patch)
treed6b2a838d1388bc404a1c5813d3fa3b84ab98daa /rootston/wl_shell.c
parent6aafc2f61a395cf72b204f487e74bd83965a41e6 (diff)
parentf402598ee115e06a9d7595042495e9b061d7530a (diff)
Merge pull request #224 from emersion/rootston-commands
Add command to close views
Diffstat (limited to 'rootston/wl_shell.c')
-rw-r--r--rootston/wl_shell.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/rootston/wl_shell.c b/rootston/wl_shell.c
index 1991d332..55ffd2eb 100644
--- a/rootston/wl_shell.c
+++ b/rootston/wl_shell.c
@@ -17,6 +17,12 @@ static void resize(struct roots_view *view, uint32_t width, uint32_t height) {
height);
}
+static void close(struct roots_view *view) {
+ assert(view->type == ROOTS_WL_SHELL_VIEW);
+ struct wlr_wl_shell_surface *surf = view->wl_shell_surface;
+ wl_client_destroy(surf->client);
+}
+
static void handle_request_move(struct wl_listener *listener, void *data) {
struct roots_wl_shell_surface *roots_surface =
wl_container_of(listener, roots_surface, request_move);
@@ -88,6 +94,7 @@ void handle_wl_shell_surface(struct wl_listener *listener, void *data) {
view->roots_wl_shell_surface = roots_surface;
view->wlr_surface = surface->surface;
view->resize = resize;
+ view->close = close;
view->desktop = desktop;
roots_surface->view = view;
list_add(desktop->views, view);