commit b04602d4325fe094835095045196285746e089e5
parent 2515f0336c9f00d728fe13c846cb0658f7d0e912
Author: Michael Forney <mforney@mforney.org>
Date: Tue, 5 Aug 2014 19:02:32 -0700
shell_surface: Implement close
Diffstat:
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/libswc/shell_surface.c b/libswc/shell_surface.c
@@ -195,8 +195,21 @@ static void configure(struct window * window,
geometry->width, geometry->height);
}
+static void close(struct window * window)
+{
+ struct shell_surface * shell_surface
+ = wl_container_of(window, shell_surface, window);
+ struct wl_client * client;
+ pid_t pid;
+
+ client = wl_resource_get_client(shell_surface->resource);
+ wl_client_get_credentials(client, &pid, NULL, NULL);
+ kill(pid, SIGTERM);
+}
+
static const struct window_impl shell_window_impl = {
- .configure = &configure
+ .configure = &configure,
+ .close = &close,
};
static void handle_surface_destroy(struct wl_listener * listener, void * data)