diff options
author | Tony Crisci <tony@dubstepdish.com> | 2017-10-07 13:04:04 -0400 |
---|---|---|
committer | Tony Crisci <tony@dubstepdish.com> | 2017-10-07 13:04:04 -0400 |
commit | 4f848000af6bdf57a6e861e69a53677f23133202 (patch) | |
tree | 341aca21d2cfd2b24021e83c4f85fa68b9f4618a /rootston/xwayland.c | |
parent | 4680943e749bfd441d31c988faa50f2b1ae043ad (diff) | |
parent | 321c26c2a3c77ddba52e1a6194669328e473fdb4 (diff) |
Merge branch 'master' into feature/xdg-popup
Diffstat (limited to 'rootston/xwayland.c')
-rw-r--r-- | rootston/xwayland.c | 21 |
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); } |