aboutsummaryrefslogtreecommitdiff
path: root/rootston/xwayland.c
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2017-11-20 17:58:26 +0100
committeremersion <contact@emersion.fr>2017-11-20 17:58:26 +0100
commit80998cdf57756fe46d55921c98a745aff4848215 (patch)
treecd66f0a7a34b35bfb3e659d8b542fefc9d765f57 /rootston/xwayland.c
parentb04a9a248d4cf3d0e93e1b39ee9eedc9da359173 (diff)
Add support for fullscreen xwayland views
Diffstat (limited to 'rootston/xwayland.c')
-rw-r--r--rootston/xwayland.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/rootston/xwayland.c b/rootston/xwayland.c
index c92c424b..5e27afed 100644
--- a/rootston/xwayland.c
+++ b/rootston/xwayland.c
@@ -92,6 +92,13 @@ static void maximize(struct roots_view *view, bool maximized) {
view->xwayland_surface, maximized);
}
+static void set_fullscreen(struct roots_view *view, bool fullscreen) {
+ assert(view->type == ROOTS_XWAYLAND_VIEW);
+
+ wlr_xwayland_surface_set_fullscreen(view->desktop->xwayland,
+ view->xwayland_surface, fullscreen);
+}
+
static void handle_destroy(struct wl_listener *listener, void *data) {
struct roots_xwayland_surface *roots_surface =
wl_container_of(listener, roots_surface, destroy);
@@ -170,6 +177,16 @@ static void handle_request_maximize(struct wl_listener *listener, void *data) {
view_maximize(view, maximized);
}
+static void handle_request_fullscreen(struct wl_listener *listener,
+ void *data) {
+ struct roots_xwayland_surface *roots_surface =
+ wl_container_of(listener, roots_surface, request_fullscreen);
+ struct roots_view *view = roots_surface->view;
+ struct wlr_xwayland_surface *xwayland_surface = view->xwayland_surface;
+
+ view_set_fullscreen(view, xwayland_surface->fullscreen, NULL);
+}
+
static void handle_map_notify(struct wl_listener *listener, void *data) {
struct roots_xwayland_surface *roots_surface =
wl_container_of(listener, roots_surface, map_notify);
@@ -223,6 +240,9 @@ void handle_xwayland_surface(struct wl_listener *listener, void *data) {
roots_surface->request_maximize.notify = handle_request_maximize;
wl_signal_add(&surface->events.request_maximize,
&roots_surface->request_maximize);
+ roots_surface->request_fullscreen.notify = handle_request_fullscreen;
+ wl_signal_add(&surface->events.request_fullscreen,
+ &roots_surface->request_fullscreen);
struct roots_view *view = calloc(1, sizeof(struct roots_view));
if (view == NULL) {
@@ -240,6 +260,7 @@ void handle_xwayland_surface(struct wl_listener *listener, void *data) {
view->move = move;
view->move_resize = move_resize;
view->maximize = maximize;
+ view->set_fullscreen = set_fullscreen;
view->close = close;
roots_surface->view = view;
view_init(view, desktop);