mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-02 09:01:38 -05:00
Disconnect wl_shell clients when closing
This commit is contained in:
parent
ecc0f712af
commit
b21f783c34
2 changed files with 29 additions and 22 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue