From ebd4bcce13d42b53ccdc5714474c6ee5bca08444 Mon Sep 17 00:00:00 2001 From: Christian Rauch Date: Fri, 5 Jan 2024 21:07:40 +0100 Subject: [PATCH] create/destroy decorations when fullscreen events are triggered externally --- components/pango_windowing/src/display_wayland.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/components/pango_windowing/src/display_wayland.cpp b/components/pango_windowing/src/display_wayland.cpp index 0bb5d3edb..51ae02da0 100644 --- a/components/pango_windowing/src/display_wayland.cpp +++ b/components/pango_windowing/src/display_wayland.cpp @@ -278,6 +278,10 @@ struct Decoration { buttons.clear(); } + bool visible() { + return !(decorations.empty() && buttons.empty()); + } + void resize(const int32_t width, const int32_t height) { for(const DecorationSurface &d : decorations) { d.resize(width, height); } for(const ButtonSurface &b : buttons) { b.reposition(width); } @@ -538,6 +542,11 @@ static void handle_configure_toplevel(void *data, struct xdg_toplevel */*xdg_top static void handle_configure(void *data, struct xdg_surface *xdg_surface, uint32_t serial) { WaylandWindow* const w = static_cast(data); + if (w->is_fullscreen && w->decoration->visible()) + w->decoration->destroy(); + else if (!w->is_fullscreen && !w->decoration->visible()) + w->decoration->create(); + // resize main surface wl_egl_window_resize(w->egl_window, w->width, w->height, 0, 0);