bevyengine / bevy

A refreshingly simple data-driven game engine built in Rust
https://bevyengine.org
Apache License 2.0
36.49k stars 3.6k forks source link

Call redraw while resizing windows #15915

Open alice-i-cecile opened 1 month ago

alice-i-cecile commented 1 month ago

Would it be possible to call redraw while we're resizing, so window gets updated immediately, rather than just stretching until we're done?

Originally posted by @MiniaczQ in https://github.com/bevyengine/bevy/pull/15814#pullrequestreview-2364967936

BenjaminBrienen commented 1 month ago

I think this should be configurable behavior, and I'd be fine with either being the default.

mrec commented 1 month ago

I remember @raphlinus posting about this being a bit hairy on Windows some years back, though things may have improved since then.

Ref: https://github.com/rust-windowing/winit/issues/786

FWIW his issues were with doing it perfectly smoothly though, not with doing it at all.

alice-i-cecile commented 1 month ago

Yeah, especially as a configurable behavior I'm fine with a bit of jank vs not doing it at all. This is much less important for Bevy than for Raph's focus on traditional desktop apps.

doup commented 1 week ago

I think I'm in the right issue, I noticed that window resizes don't lag anymore… but now it stretches in a funny way. I just wanted to share a video:

https://github.com/user-attachments/assets/6c86fc69-5623-49db-b895-570c4d2ce33b

This case is worse though (wait until the end of the video), when the resize is triggered by doble-clicking on the title bar (macOS) there is a huge delay until it refreshes. In this case I'm not moving the cursor after the resize which, I think, makes it worse:

https://github.com/user-attachments/assets/b83cf288-5f1b-4bcb-98fb-e8b9220890eb

MiniaczQ commented 1 week ago

It appears to be the discrepancy between layout engine and window stretching to fit