aboutsummaryrefslogtreecommitdiff
path: root/rootston/xwayland.c
diff options
context:
space:
mode:
Diffstat (limited to 'rootston/xwayland.c')
-rw-r--r--rootston/xwayland.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/rootston/xwayland.c b/rootston/xwayland.c
index 7ecc4d4f..c32ee15b 100644
--- a/rootston/xwayland.c
+++ b/rootston/xwayland.c
@@ -9,6 +9,16 @@
#include "rootston/desktop.h"
#include "rootston/server.h"
+static void activate(struct roots_view *view, bool active) {
+ assert(view->type == ROOTS_XWAYLAND_VIEW);
+ if (active) {
+ wlr_xwayland_surface_activate(view->desktop->xwayland,
+ view->xwayland_surface);
+ } else {
+ wlr_xwayland_surface_activate(view->desktop->xwayland, NULL);
+ }
+}
+
static void resize(struct roots_view *view, uint32_t width, uint32_t height) {
assert(view->type == ROOTS_XWAYLAND_VIEW);
struct wlr_xwayland_surface *xwayland_surface = view->xwayland_surface;
@@ -16,6 +26,11 @@ static void resize(struct roots_view *view, uint32_t width, uint32_t height) {
xwayland_surface->x, xwayland_surface->y, width, height);
}
+static void close(struct roots_view *view) {
+ assert(view->type == ROOTS_XWAYLAND_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);
@@ -38,11 +53,6 @@ static void handle_request_configure(struct wl_listener *listener, void *data) {
xwayland_surface, event->x, event->y, event->width, event->height);
}
-static void activate(struct roots_view *view, bool active) {
- wlr_xwayland_surface_activate(view->desktop->xwayland,
- view->xwayland_surface);
-}
-
void handle_xwayland_surface(struct wl_listener *listener, void *data) {
struct roots_desktop *desktop =
wl_container_of(listener, desktop, xwayland_surface);
@@ -78,6 +88,7 @@ void handle_xwayland_surface(struct wl_listener *listener, void *data) {
view->desktop = desktop;
view->activate = activate;
view->resize = resize;
+ view->close = close;
roots_surface->view = view;
list_add(desktop->views, view);
}