aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlia Bozhinov <ammen99@gmail.com>2019-04-26 17:10:21 +0200
committerSimon Ser <contact@emersion.fr>2019-04-29 00:00:53 +0300
commit8cc08598146b2780ae127713f58b182ed8b11f7c (patch)
tree1bea5141e0aed7aaf41a48fdb4d1fabcb6e57198
parent4e6c17a7c9d419112f147ddd62a40d942382ab8e (diff)
rootston: add support for foreign-toplevel fullscreening
-rw-r--r--include/rootston/view.h1
-rw-r--r--rootston/view.c17
2 files changed, 18 insertions, 0 deletions
diff --git a/include/rootston/view.h b/include/rootston/view.h
index 1a56de4b..1c5dcaff 100644
--- a/include/rootston/view.h
+++ b/include/rootston/view.h
@@ -67,6 +67,7 @@ struct roots_view {
struct wlr_foreign_toplevel_handle_v1 *toplevel_handle;
struct wl_listener toplevel_handle_request_maximize;
struct wl_listener toplevel_handle_request_activate;
+ struct wl_listener toplevel_handle_request_fullscreen;
struct wl_listener toplevel_handle_request_close;
struct wl_listener new_subsurface;
diff --git a/rootston/view.c b/rootston/view.c
index a5bc3aff..6619743a 100644
--- a/rootston/view.c
+++ b/rootston/view.c
@@ -273,6 +273,11 @@ void view_set_fullscreen(struct roots_view *view, bool fullscreen,
view->impl->set_fullscreen(view, fullscreen);
}
+ if (view->toplevel_handle) {
+ wlr_foreign_toplevel_handle_v1_set_fullscreen(view->toplevel_handle,
+ fullscreen);
+ }
+
if (!was_fullscreen && fullscreen) {
if (output == NULL) {
output = view_get_output(view);
@@ -641,6 +646,14 @@ static void handle_toplevel_handle_request_activate(struct wl_listener *listener
}
}
+static void handle_toplevel_handle_request_fullscreen(struct wl_listener *listener,
+ void *data) {
+ struct roots_view *view =
+ wl_container_of(listener, view, toplevel_handle_request_fullscreen);
+ struct wlr_foreign_toplevel_handle_v1_fullscreen_event *event = data;
+ view_set_fullscreen(view, event->fullscreen, event->output);
+}
+
static void handle_toplevel_handle_request_close(struct wl_listener *listener,
void *data) {
struct roots_view *view =
@@ -661,6 +674,10 @@ void view_create_foreign_toplevel_handle(struct roots_view *view) {
handle_toplevel_handle_request_activate;
wl_signal_add(&view->toplevel_handle->events.request_activate,
&view->toplevel_handle_request_activate);
+ view->toplevel_handle_request_fullscreen.notify =
+ handle_toplevel_handle_request_fullscreen;
+ wl_signal_add(&view->toplevel_handle->events.request_fullscreen,
+ &view->toplevel_handle_request_fullscreen);
view->toplevel_handle_request_close.notify =
handle_toplevel_handle_request_close;
wl_signal_add(&view->toplevel_handle->events.request_close,