diff options
-rw-r--r-- | include/rootston/view.h | 1 | ||||
-rw-r--r-- | rootston/view.c | 17 |
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, |