-
-
Notifications
You must be signed in to change notification settings - Fork 21.8k
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
DisplayServer: Window set_position semantics change based on single window mode #61263
Comments
Confirming this for v4.0.alpha11.official [afdae67] and Ubuntu. Reproduction: You require at least two monitors to reproduce this.
edit: reading this again this might be a different issue. what I am describing definitely seems to be a bug. |
The single-window-mode config-option can change, who the embedder of a Window is. But since this is a user-configurable option, the user should know, if it is switched on or not. So in most cases, this should not be a problem. In the other cases, for convenience the three functions var c: Control = $Control
var w: Window = $"Control/Window"
w.position = c.get_screen_position() This script will position the Window so that it is at the location of the Control, not matter, where the Window is embedded. |
Closing following above comment. |
Godot version
4.0 dev (4173a47)
System information
Windows 10
Issue description
Summary
The Window::set_position(...) call takes coordinates as an argument and moves a window (top level OR popup) to that location/
In single window mode it takes coordinates relative to the main window, presumably like 3.x.
In multi window mode it takes absolute screen coordinates, so things can end up on an entirely different monitor for example.
Impact
Any application code using this API that works as expected in single window mode won't do the right thing in multi window mode and vice versa, unless the code always checks the window mode.
Commentary
It might be better if 4.0 had a separate Window::set_screeen_position or something like that if the semantics are going to be that different. Or screen-space positioning could be done relative to a Display, so that you have to specify both.
This was only tested on Windows.
Steps to reproduce
This is an internal issue against the API. Reproducing it requires writing code to use that API and calling it and observing the results in both single- and multi window modes.
Minimal reproduction project
No response
The text was updated successfully, but these errors were encountered: