From 1dfc6fdb32567b4a3ebbb9b9e9e0638b164d364f Mon Sep 17 00:00:00 2001 From: simplejack-src <44681794+simplejack-src@users.noreply.github.com> Date: Tue, 29 Aug 2023 05:01:27 -0400 Subject: [PATCH] core: Backport 'Implement wlr_foregin_toplevel_handle's fullscreen management (#1557)' fix (#1771) (#1772) --- src/view/view-impl.cpp | 12 ++++++++++++ src/view/view-impl.hpp | 1 + 2 files changed, 13 insertions(+) diff --git a/src/view/view-impl.cpp b/src/view/view-impl.cpp index f9610db12..4f247a574 100644 --- a/src/view/view-impl.cpp +++ b/src/view/view-impl.cpp @@ -5,6 +5,7 @@ #include "wayfire/decorator.hpp" #include "wayfire/signal-definitions.hpp" #include "wayfire/workspace-manager.hpp" +#include "wayfire/output-layout.hpp" #include #include "xdg-shell.hpp" @@ -442,6 +443,13 @@ void wf::wlr_view_t::create_toplevel() handle_minimize_hint(surface, {ev->x, ev->y, ev->width, ev->height}); }); + toplevel_handle_v1_fullscreen_request.set_callback([&] (void *data) + { + auto ev = static_cast(data); + auto wo = wf::get_core().output_layout->find_output(ev->output); + fullscreen_request(wo, ev->fullscreen); + }); + toplevel_handle_v1_maximize_request.connect( &toplevel_handle->events.request_maximize); toplevel_handle_v1_minimize_request.connect( @@ -452,6 +460,8 @@ void wf::wlr_view_t::create_toplevel() &toplevel_handle->events.set_rectangle); toplevel_handle_v1_close_request.connect( &toplevel_handle->events.request_close); + toplevel_handle_v1_fullscreen_request.connect( + &toplevel_handle->events.request_fullscreen); toplevel_send_title(); toplevel_send_app_id(); @@ -471,6 +481,7 @@ void wf::wlr_view_t::destroy_toplevel() toplevel_handle_v1_minimize_request.disconnect(); toplevel_handle_v1_set_rectangle_request.disconnect(); toplevel_handle_v1_close_request.disconnect(); + toplevel_handle_v1_fullscreen_request.disconnect(); wlr_foreign_toplevel_handle_v1_destroy(toplevel_handle); toplevel_handle = nullptr; @@ -528,6 +539,7 @@ void wf::wlr_view_t::toplevel_send_state() tiled_edges == TILED_EDGES_ALL); wlr_foreign_toplevel_handle_v1_set_activated(toplevel_handle, activated); wlr_foreign_toplevel_handle_v1_set_minimized(toplevel_handle, minimized); + wlr_foreign_toplevel_handle_v1_set_fullscreen(toplevel_handle, fullscreen); /* update parent as well */ wf::wlr_view_t *parent_ptr = dynamic_cast(parent.get()); diff --git a/src/view/view-impl.hpp b/src/view/view-impl.hpp index 8f34941dd..7b6155f4b 100644 --- a/src/view/view-impl.hpp +++ b/src/view/view-impl.hpp @@ -198,6 +198,7 @@ class wlr_view_t : toplevel_handle_v1_activate_request, toplevel_handle_v1_minimize_request, toplevel_handle_v1_set_rectangle_request, + toplevel_handle_v1_fullscreen_request, toplevel_handle_v1_close_request; /* Create/destroy the toplevel_handle */