aboutsummaryrefslogtreecommitdiff
path: root/rootston
diff options
context:
space:
mode:
Diffstat (limited to 'rootston')
-rw-r--r--rootston/wl_shell.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/rootston/wl_shell.c b/rootston/wl_shell.c
index 67c8f609..fffd9fc9 100644
--- a/rootston/wl_shell.c
+++ b/rootston/wl_shell.c
@@ -10,17 +10,30 @@
#include "rootston/server.h"
#include "rootston/input.h"
+static void handle_destroy(struct wl_listener *listener, void *data) {
+ struct roots_wl_shell_surface *roots_surface =
+ wl_container_of(listener, roots_surface, destroy);
+ wl_list_remove(&roots_surface->destroy.link);
+ wl_list_remove(&roots_surface->ping_timeout.link);
+ view_destroy(roots_surface->view);
+ free(roots_surface);
+}
+
void handle_wl_shell_surface(struct wl_listener *listener, void *data) {
struct roots_desktop *desktop =
wl_container_of(listener, desktop, wl_shell_surface);
struct wlr_wl_shell_surface *surface = data;
- wlr_log(L_DEBUG, "new wl_shell surface");
- //wlr_wl_shell_surface_ping(surface);
+ wlr_log(L_DEBUG, "new shell surface: title=%s, class=%s",
+ surface->title, surface->class_);
+ //wlr_wl_shell_surface_ping(surface); // TODO: segfaults
struct roots_wl_shell_surface *roots_surface =
calloc(1, sizeof(struct roots_wl_shell_surface));
// TODO: all of the trimmings
+ wl_list_init(&roots_surface->destroy.link);
+ roots_surface->destroy.notify = handle_destroy;
+ wl_list_init(&roots_surface->ping_timeout.link);
struct roots_view *view = calloc(1, sizeof(struct roots_view));
view->type = ROOTS_WL_SHELL_VIEW;