GPUI: Wayland: Add fullscreen, minimize and avoid unnecessary resizes (#9060)

Release Notes:
- N/A
This commit is contained in:
bbb651 2024-03-09 05:52:36 +02:00 committed by GitHub
parent 146971fb02
commit efe5203a09
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 65 additions and 26 deletions

View file

@ -520,15 +520,16 @@ impl Dispatch<xdg_toplevel::XdgToplevel, ()> for WaylandClientState {
if let xdg_toplevel::Event::Configure {
width,
height,
states: _states,
states,
} = event
{
if width == 0 || height == 0 {
return;
}
let width = NonZeroU32::new(width as u32);
let height = NonZeroU32::new(height as u32);
let fullscreen = states.contains(&(xdg_toplevel::State::Fullscreen as u8));
for window in &state.windows {
if window.1.toplevel.id() == xdg_toplevel.id() {
window.1.resize(width, height);
window.1.set_fullscreen(fullscreen);
window.1.surface.commit();
return;
}