aboutsummaryrefslogtreecommitdiff
path: root/rootston/xwayland.c
diff options
context:
space:
mode:
authorTony Crisci <tony@dubstepdish.com>2017-11-30 03:25:05 -0500
committerGitHub <noreply@github.com>2017-11-30 03:25:05 -0500
commit5d7eb438d9dde68ce185daf977a0c27a1398bbc9 (patch)
treec0fc4c18bbc930e80e162ccd217e751380c1372f /rootston/xwayland.c
parentbc113c16aab5fed2a937ddb8b2b560eaef28620d (diff)
parentcc2468923b134cdf6d980b2930cd80f0d15e96e3 (diff)
Merge pull request #437 from emersion/fullscreen
Fullscreen support
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 628c0e07..2b17ee3f 100644
--- a/rootston/xwayland.c
+++ b/rootston/xwayland.c
@@ -103,6 +103,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);
@@ -186,6 +193,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_surface_commit(struct wl_listener *listener, void *data) {
struct roots_xwayland_surface *roots_surface =
wl_container_of(listener, roots_surface, surface_commit);
@@ -266,6 +283,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);
roots_surface->surface_commit.notify = handle_surface_commit;
wl_signal_add(&surface->surface->events.commit,
@@ -287,6 +307,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);