Skip to content

Commit

Permalink
On Wayland, ensure initial resize delivery
Browse files Browse the repository at this point in the history
While we correctly configure the sizes, we also need to actually resize
the frame on initial configure and send geometry.

Fixes rust-windowing#3277.
  • Loading branch information
kchibisov authored Dec 21, 2023
1 parent a676d00 commit 8b5c84f
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/platform_impl/linux/wayland/window/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -357,13 +357,17 @@ impl WindowState {
let old_state = self
.last_configure
.as_ref()
.map(|configure| configure.state)
.unwrap_or(XdgWindowState::empty());

let state_change_requires_resize = !new_state
.symmetric_difference(old_state)
.difference(XdgWindowState::ACTIVATED | XdgWindowState::SUSPENDED)
.is_empty();
.map(|configure| configure.state);

let state_change_requires_resize = old_state
.map(|old_state| {
!old_state
.symmetric_difference(new_state)
.difference(XdgWindowState::ACTIVATED | XdgWindowState::SUSPENDED)
.is_empty()
})
// NOTE: `None` is present for the initial configure, thus we must always resize.
.unwrap_or(true);

// NOTE: Set the configure before doing a resize, since we query it during it.
self.last_configure = Some(configure);
Expand Down

0 comments on commit 8b5c84f

Please sign in to comment.