Skip to content

Commit

Permalink
core: Backport 'Implement wlr_foregin_toplevel_handle's fullscreen ma…
Browse files Browse the repository at this point in the history
…nagement (#1557)' fix (#1771) (#1772)
  • Loading branch information
simplejack-src authored Aug 29, 2023
1 parent 6057d36 commit 1dfc6fd
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/view/view-impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "wayfire/decorator.hpp"
#include "wayfire/signal-definitions.hpp"
#include "wayfire/workspace-manager.hpp"
#include "wayfire/output-layout.hpp"
#include <wayfire/util/log.hpp>

#include "xdg-shell.hpp"
Expand Down Expand Up @@ -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<wlr_foreign_toplevel_handle_v1_fullscreen_event*>(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(
Expand All @@ -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();
Expand All @@ -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;
Expand Down Expand Up @@ -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<wf::wlr_view_t*>(parent.get());
Expand Down
1 change: 1 addition & 0 deletions src/view/view-impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 1dfc6fd

Please sign in to comment.