Describe the bug
On wayland (mutter) when the window is resized using ViewportCommand::InnerSize the viewport size doesn't match the window.
| Drag Resize Handle |
Press "Phone Size" |
Drag Resize Handle |
Press "Desktop Size" |
 |
 |
 |
 |
I suspect this is because winit doesn't send Resized events after the resize, the correct way to handle this is applying the value returned from request_inner_size to the viewport here:
|
ViewportCommand::InnerSize(size) => { |
|
let width_px = pixels_per_point * size.x.max(1.0); |
|
let height_px = pixels_per_point * size.y.max(1.0); |
|
if window |
|
.request_inner_size(PhysicalSize::new(width_px, height_px)) |
|
.is_some() |
|
{ |
|
log::debug!("ViewportCommand::InnerSize ignored by winit"); |
|
} |
|
} |
To Reproduce
Steps to reproduce the behavior:
- On gnome shell press the Phone Size button, note the window contents are stretched
- Resize the window, note the window contents are not stretched
- Repeat
Expected behavior
Contents are not stretched
Screenshots
Desktop (please complete the following information):
#4197 makes it easier to test.
Describe the bug
On wayland (mutter) when the window is resized using
ViewportCommand::InnerSizethe viewport size doesn't match the window.I suspect this is because winit doesn't send
Resizedevents after the resize, the correct way to handle this is applying the value returned fromrequest_inner_sizeto the viewport here:egui/crates/egui-winit/src/lib.rs
Lines 1313 to 1322 in d449cb1
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Contents are not stretched
Screenshots
Desktop (please complete the following information):
#4197 makes it easier to test.