diff options
author | emersion <contact@emersion.fr> | 2017-09-27 21:15:31 +0200 |
---|---|---|
committer | emersion <contact@emersion.fr> | 2017-09-27 21:15:31 +0200 |
commit | 663bfe4cd8a8c2c9f0de285c8112b108e9a61bae (patch) | |
tree | 858810cd3530681753ee4d0dd57b3a50cfea96a6 /rootston | |
parent | e001e400221115b0fe41fb48df48e85a2ec4f6ba (diff) |
wlr_wl_shell: implement all requests except set_popup
Diffstat (limited to 'rootston')
-rw-r--r-- | rootston/wl_shell.c | 17 |
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; |