-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set main window min. size via Window object instead of DisplayServer to preserve it during window updates. #70863
Conversation
…to preserve it during window updates.
I think a note should be added to the DisplayServer's method descriptions that calling them without changing the window itself does not work and may lead to bugs. And give that example on how to change the size of the main window too. That said, while this seems like a correct fix, I still wonder if the current behavior is intended. Do we expect the DisplayServer to be the authority in that regard or do we not? If it is intended, then |
Does this help with #62869? |
IMO the windowing API in general could have quite a few improvements (for example I'd prefer a viewport to be just... A viewport and not have embedded window logic as a specific mechanism mixed all in there along multiple classes or being extended into the That said, as of now the main window's default min/max size is broken and this PR fixes this issue without changing the actual API, using the already existing one "properly", so I'm definitely in favor of this change. |
@Riteo So, my question was two-fold. First, I asked if the current behavior was intended. Because if not, then this needs to be fixed before we go in 4.0. It doesn't require changing any API, only fixing the logic in code, making sure windows respect the However, and this is the second part, having to set the size of the window through the Window node should not be that convoluted for the main window. It's okay for subwindows, as you already have them as nodes in your scenes. But for the main window doing All that said, we can merge this as is, it doesn't hurt. But it's also kind of a hack, and it would be nice to know beforehand if this is intended to be done this way or if the original code was supposed to work but it wasn't implemented proper. Probably only @reduz knows the answer to that. Adding new API to simplify |
No idea, but considering that there is a
Definitely agree.
That's great! |
I confirmed with @reduz that you are not supposed to use |
Thanks! |
Fixes #70347
Note: when setting min/max window size from the
_ready
method, it should be done via Window object as well, e.g.get_tree().get_root().set_min_size(Vector2(1000, 1000))
.