summaryrefslogtreecommitdiffstats
path: root/sway/desktop/wl_shell.c
diff options
context:
space:
mode:
authorLibravatar Tony Crisci <tony@dubstepdish.com>2018-01-20 14:10:11 -0500
committerLibravatar Tony Crisci <tony@dubstepdish.com>2018-01-20 14:10:11 -0500
commitc353e01c85049cfbc09510657e453b6aa5fd9c2d (patch)
treec6ef14cfc08861ff8c62675ca1fbbbb00e9197cf /sway/desktop/wl_shell.c
parentseat config handler context (diff)
downloadsway-c353e01c85049cfbc09510657e453b6aa5fd9c2d.tar.gz
sway-c353e01c85049cfbc09510657e453b6aa5fd9c2d.tar.zst
sway-c353e01c85049cfbc09510657e453b6aa5fd9c2d.zip
add kill command
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) {
51 // no way to activate wl_shell 51 // no way to activate wl_shell
52} 52}
53 53
54static void close(struct sway_view *view) {
55 if (!assert_wl_shell(view)) {
56 return;
57 }
58
59 wl_client_destroy(view->wlr_wl_shell_surface->client);
60}
61
54static void handle_commit(struct wl_listener *listener, void *data) { 62static void handle_commit(struct wl_listener *listener, void *data) {
55 struct sway_wl_shell_surface *sway_surface = 63 struct sway_wl_shell_surface *sway_surface =
56 wl_container_of(listener, sway_surface, commit); 64 wl_container_of(listener, sway_surface, commit);
@@ -103,6 +111,7 @@ void handle_wl_shell_surface(struct wl_listener *listener, void *data) {
103 sway_view->iface.set_size = set_size; 111 sway_view->iface.set_size = set_size;
104 sway_view->iface.set_position = set_position; 112 sway_view->iface.set_position = set_position;
105 sway_view->iface.set_activated = set_activated; 113 sway_view->iface.set_activated = set_activated;
114 sway_view->iface.close = close;
106 sway_view->wlr_wl_shell_surface = shell_surface; 115 sway_view->wlr_wl_shell_surface = shell_surface;
107 sway_view->sway_wl_shell_surface = sway_surface; 116 sway_view->sway_wl_shell_surface = sway_surface;
108 sway_view->surface = shell_surface->surface; 117 sway_view->surface = shell_surface->surface;