GPUI: Wayland: Add fullscreen, minimize and avoid unnecessary resizes (#9060)
Release Notes: - N/A
This commit is contained in:
parent
146971fb02
commit
efe5203a09
2 changed files with 65 additions and 26 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue