Skip to content

Commit

Permalink
create/destroy decorations when fullscreen events are triggered exter…
Browse files Browse the repository at this point in the history
…nally
  • Loading branch information
christian-rauch committed Jan 5, 2024
1 parent 924d1e1 commit ebd4bcc
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions components/pango_windowing/src/display_wayland.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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); }
Expand Down Expand Up @@ -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<WaylandWindow*>(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);

Expand Down

0 comments on commit ebd4bcc

Please sign in to comment.