diff options
author | emersion <contact@emersion.fr> | 2017-10-06 16:44:55 +0200 |
---|---|---|
committer | emersion <contact@emersion.fr> | 2017-10-06 16:44:55 +0200 |
commit | b21f783c34f145545b0109b06b135cd1e9fa8b70 (patch) | |
tree | ea17b686a6e28532e83a6d9d34e31c59df6d2c46 /rootston/xwayland.c | |
parent | ecc0f712af823e1017f000ddf65d79f4e2ecd601 (diff) |
Disconnect wl_shell clients when closing
Diffstat (limited to 'rootston/xwayland.c')
-rw-r--r-- | rootston/xwayland.c | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/rootston/xwayland.c b/rootston/xwayland.c index 4b833ef1..c32ee15b 100644 --- a/rootston/xwayland.c +++ b/rootston/xwayland.c @@ -9,28 +9,6 @@ #include "rootston/desktop.h" #include "rootston/server.h" -static void handle_destroy(struct wl_listener *listener, void *data) { - struct roots_xwayland_surface *roots_surface = - wl_container_of(listener, roots_surface, destroy); - wl_list_remove(&roots_surface->destroy.link); - view_destroy(roots_surface->view); - free(roots_surface); -} - -static void handle_request_configure(struct wl_listener *listener, void *data) { - struct roots_xwayland_surface *roots_surface = - wl_container_of(listener, roots_surface, request_configure); - struct wlr_xwayland_surface *xwayland_surface = - roots_surface->view->xwayland_surface; - struct wlr_xwayland_surface_configure_event *event = data; - - roots_surface->view->x = (double)event->x; - roots_surface->view->y = (double)event->y; - - wlr_xwayland_surface_configure(roots_surface->view->desktop->xwayland, - xwayland_surface, event->x, event->y, event->width, event->height); -} - static void activate(struct roots_view *view, bool active) { assert(view->type == ROOTS_XWAYLAND_VIEW); if (active) { @@ -53,6 +31,28 @@ static void close(struct roots_view *view) { wlr_xwayland_surface_close(view->desktop->xwayland, view->xwayland_surface); } +static void handle_destroy(struct wl_listener *listener, void *data) { + struct roots_xwayland_surface *roots_surface = + wl_container_of(listener, roots_surface, destroy); + wl_list_remove(&roots_surface->destroy.link); + view_destroy(roots_surface->view); + free(roots_surface); +} + +static void handle_request_configure(struct wl_listener *listener, void *data) { + struct roots_xwayland_surface *roots_surface = + wl_container_of(listener, roots_surface, request_configure); + struct wlr_xwayland_surface *xwayland_surface = + roots_surface->view->xwayland_surface; + struct wlr_xwayland_surface_configure_event *event = data; + + roots_surface->view->x = (double)event->x; + roots_surface->view->y = (double)event->y; + + wlr_xwayland_surface_configure(roots_surface->view->desktop->xwayland, + xwayland_surface, event->x, event->y, event->width, event->height); +} + void handle_xwayland_surface(struct wl_listener *listener, void *data) { struct roots_desktop *desktop = wl_container_of(listener, desktop, xwayland_surface); |