-
-
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
Don't use saved editor dialog size in single-window-mode. #75141
Conversation
It might be nice to re-position the dialog if the parent window size changes, but I checked |
I don't think this improves the situation meaningfully. If a dialog has a big enough size by default, it will still slide off of the screen. I think we should address this properly, instead of restoring a behavior to be similar to 3.x. Dialogs need to respect the size of their parent window when embedded, and treat it as their max size. This should likely be an option, not a default behavior, as the opposite may still be useful in games and apps made with Godot. |
Thanks for the feedback @YuriSizov. I agree this isn't ideal, but I'm not quite following you. Are you saying that if |
I think you follow me quite well :) IMO we should try both. If the size is within the parent's size, just slide it over. If it's bigger, then resize it to fit. But again, this should probably be a flag on the Window node, and not the default behavior. We need it for the editor, but it may still be desirable for other projects to spawn windows out of frame. Or it can be a new method that takes a rect2 and fits it into the Window's area. So you can use this feature dynamically instead, whenever you need to. |
NVM. 8be16e0 was just about being able to drag windows outside the editor bounds. |
I think it should apply here, yes. If you can't drag a window outside, then I think it's safe to assume you don't want to spawn it outside either. |
I updated it so windows that are clamped to their embedder are now automatically shifted/resized on popup, and when the parent is resized. In the recording, there's a lag when I resize the parent. That only happens when I'm recording, so I'm guessing it's something weird with X11 and SSR? It seems reponsive when I'm not recording the screen. ssr-2023-03-24_21.12.37.mp4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great to me! Will wait a bit for another review, but this should be good to merge.
Fixes godotengine#75084. The clamp_to_embedder setting was added in 8be16e0, but was not set on any of the in-editor dialogs. This patch sets `clamp_to_embedder` on editor dialogs so they cannot be dragged out of the frame. This also modifies `clamp_to_embedder` so a window is clamped to the bounds of an embedder when it pops up and when the parent is resized.
Thanks! |
Was fixed for 4.1 in godotengine#75141, but as part of a larger fix
Fixes #75084.
If single_window_mode is enabled, trying to place editor dialogs with a saved size
often looks wrong if the main editor window has been resized.
This can result in windows being partially (or mostly) off-screen,
or just off-centered.