Commit bf4ab1f
The max window size resize constraint should be unset if set to infinity (#20079)
# Objective
The problem here is that if one tries to set the window resize
constraint back to e.g. Default::default() where the max window size
happens to be infinity then the max window resize constraint won't
actually be changed at all, thus making it impossible to actually do
this change.
I believe this logic might be copied from the window creation logic over
here:
https://github.com/bevyengine/bevy/blob/6792cebfd0d49a167aeb70fa03a136a512707e53/crates/bevy_winit/src/winit_windows.rs#L262
In that instance the logic makes sense because it is known that the max
size constraint will be None, since it's initialized to default at the
top of that function.
## Solution
Unconditionally set the max size constraint, just to None if either
dimension is Infinity, which should produce the same outcome as the
window creation logic
## Testing
- Did you test these changes? If so, how?
Only in so far that I confirmed the problem: if you try to change resize
constraints back to Default::default() then no change will be made to
the max resize constraint. This was confirmed after spotting the issue,
so spotting it clearly had some predictive power.
- Are there any parts that need more testing?
- How can other people (reviewers) test your changes? Is there anything
specific they need to know?
- If relevant, what platforms did you test these changes on, and are
there any important ones you can't test?
I found this problem when researching a different problem that only
shows up on X11, where the resize constraint prevents full screen from
working correctly. Unfortunately we've confirmed that fixing this
problem, while helpful on Windows, isn't enough to fix the full issue on
X11. But that problem is unrelated to this and needs to be done in
addition to this one, which is clearly a bug on every platform.
Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>1 parent cd41c83 commit bf4ab1f
1 file changed
+7
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
435 | 435 | | |
436 | 436 | | |
437 | 437 | | |
438 | | - | |
439 | | - | |
440 | | - | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
441 | 445 | | |
442 | 446 | | |
443 | 447 | | |
| |||
0 commit comments