Open MikeSchulze opened 1 year ago
What way is it supposed to work when minimized, with no window or area to wrap in?
What way is it supposed to work when minimized, with no window or area to wrap in?
As I understand it, warp_mouse()
should teleport the cursor to absolute coordinates on screen when the window is minimized.
cc @bruvzg
I can confirm this Issue on Windows. Linux X11 Xfce doesn't have this problem, so it is likely that this is a Windows-only behavior.
Input
knows about the currently focused window, but knows nothing about screen coordinates.
So Input.warp_mouse()
is always relative to the position of the currently focused window. For this it relies on the DisplayServer
-interpretation, where the focused windows is.
@Calinou the latest documentation doesn't say anything about warping to absolute screen coordinates (it speaks in terms of the currently focused window); are you suggesting the behavior should be amended to warp to absolute screen coordinates in the case of the window being minimized (or not otherwise visible)? Not a problem, just making sure that's the intent. I have a fix for this issue already, but looking for verification of this behavior.
@Calinou the latest documentation doesn't say anything about warping to absolute screen coordinates (it speaks in terms of the currently focused window); are you suggesting the behavior should be amended to warp to absolute screen coordinates in the case of the window being minimized (or not otherwise visible)? Not a problem, just making sure that's the intent. I have a fix for this issue already, but looking for verification of this behavior.
I wouldn't change existing behavior when the window is visible in the interest of backwards compatibility. When the window is invisible however, we need to create behavior that makes sense, as I don't think this ever worked properly in the past.
I can confirm this Issue on Windows. Linux X11 Xfce doesn't have this problem, so it is likely that this is a Windows-only behavior.
Input
knows about the currently focused window, but knows nothing about screen coordinates. SoInput.warp_mouse()
is always relative to the position of the currently focused window. For this it relies on theDisplayServer
-interpretation, where the focused windows is.
Is not Windows only problem, but also happening in Wayland.
Is not Windows only problem, but also happening in Wayland.
Regarding the Wayland part, we can do nothing about it by design. See #90213.
Godot version
v4.0.rc1.official [8843d9ad3]
System information
Windows 10
Issue description
I working on my unit testing API and run into this issue.
The API provides a scene runner to simulate interactions like key/mouse events During testing the implementation i found out the
Input.warp_mouse()
is not working when set the display mode toWINDOW_MODE_MINIMIZED
I set the display mode by default to minimized to hide the test runner scene.On Godot3 it was working in the minimized mode but is broken on Godot4
Steps to reproduce
load the attache example project
Minimal reproduction project
warp_mouse.zip