aboutsummaryrefslogtreecommitdiff
path: root/sway/desktop/wl_shell.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/desktop/wl_shell.c')
-rw-r--r--sway/desktop/wl_shell.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/sway/desktop/wl_shell.c b/sway/desktop/wl_shell.c
index e34f5160..0cde6583 100644
--- a/sway/desktop/wl_shell.c
+++ b/sway/desktop/wl_shell.c
@@ -51,6 +51,14 @@ static void set_activated(struct sway_view *view, bool activated) {
// no way to activate wl_shell
}
+static void close(struct sway_view *view) {
+ if (!assert_wl_shell(view)) {
+ return;
+ }
+
+ wl_client_destroy(view->wlr_wl_shell_surface->client);
+}
+
static void handle_commit(struct wl_listener *listener, void *data) {
struct sway_wl_shell_surface *sway_surface =
wl_container_of(listener, sway_surface, commit);
@@ -103,6 +111,7 @@ void handle_wl_shell_surface(struct wl_listener *listener, void *data) {
sway_view->iface.set_size = set_size;
sway_view->iface.set_position = set_position;
sway_view->iface.set_activated = set_activated;
+ sway_view->iface.close = close;
sway_view->wlr_wl_shell_surface = shell_surface;
sway_view->sway_wl_shell_surface = sway_surface;
sway_view->surface = shell_surface->surface;