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 b63b967
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 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 @@ -518,11 +522,17 @@ static void handle_configure_toplevel(void *data, struct xdg_toplevel */*xdg_top

if(!w->is_fullscreen && (width!=0 && height!=0)) {
// has decoration
if (!w->decoration->visible()) {
w->decoration->create();
}
w->decoration->toContentSize(restore_w, restore_h, w->width, w->height);
w->width = std::max(w->width, int(min_width));
w->height = std::max(w->height, int(min_height));
}
else {
if (w->decoration->visible()) {
w->decoration->destroy();
}
w->width = restore_w;
w->height = restore_h;
}
Expand Down

0 comments on commit b63b967

Please sign in to comment.