commit b04602d

Michael Forney  ·  2014-08-06 02:02:32 +0000 UTC
parent 2515f03
shell_surface: Implement close
1 files changed,  +14, -1
+14, -1
 1@@ -195,8 +195,21 @@ static void configure(struct window * window,
 2                                     geometry->width, geometry->height);
 3 }
 4 
 5+static void close(struct window * window)
 6+{
 7+    struct shell_surface * shell_surface
 8+        = wl_container_of(window, shell_surface, window);
 9+    struct wl_client * client;
10+    pid_t pid;
11+
12+    client = wl_resource_get_client(shell_surface->resource);
13+    wl_client_get_credentials(client, &pid, NULL, NULL);
14+    kill(pid, SIGTERM);
15+}
16+
17 static const struct window_impl shell_window_impl = {
18-    .configure = &configure
19+    .configure = &configure,
20+    .close = &close,
21 };
22 
23 static void handle_surface_destroy(struct wl_listener * listener, void * data)