Skip to content
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

In-Game: window_mouse_set() malfunctions when the game window is positioned at 0,0 #8600

Open
gm-bug-reporter bot opened this issue Dec 3, 2024 · 0 comments
Assignees
Labels
project This issue has a sample project attached runner-bug In-game bugs with the "GameMaker Studio 2" runtimes

Comments

@gm-bug-reporter
Copy link

Description

When in windowed mode and the window position is <0, 0>:

  • window_mouse_set does not position the mouse at the intended coordinates, but at an offset position instead. The offset might be equal to the thickness of the top and left window "chrome" (the OS gaphical UI border).
    • In this situation, window_mouse_get_delta_x/y correctly return 0 when the mouse is at rest, unlike the next situation:
  • If using window_mouse_set_locked(true), window_mouse_get_delta_x/y constantly return nonzero numbers when the mouse is at rest.
    • The mouse is not being locked at the window center, but the manual does not specify what position the mouse gets locked to, so the only explicit malfunction here is the nonzero mouse delta when at rest. It hardly seems coincidental, however, that the amount by which it is wrong is the same offset experienced when trying to set the mouse to the window center via window_mouse_set(window_get_width()/2, window_get_height()/2).

If the window is at any(?) other position, even <1, 0>, everything works correctly.

Problem observed in Windows VM and YYC; untested on other platforms.

Steps To Reproduce

Run the attached example project, and use the Enter key to switch mouse positions, and Space key to move the window position between <0, 0> (malfunctioning) and <1, 0> (working correctly)

Or, specifically:
Call window_set_position(0, 0) then try using either window_mouse_set, or window_mouse_get_delta_x/y in conjunction with window_mouse_set_locked(true)

Which version of GameMaker are you reporting this issue for?

IDE v2024.800.0.618 Runtime v2024.800.0.642

Which operating system(s) are you seeing the problem on?

Windows 6.1.7601.0

Which platform(s) are you seeing the problem on?

Windows

4bc7b11f-d076-4509-8c19-7a8327a9a65f

@gm-bug-reporter gm-bug-reporter bot added project This issue has a sample project attached runner-bug In-game bugs with the "GameMaker Studio 2" runtimes labels Dec 3, 2024
@YYDan YYDan changed the title Setting mouse position malfunctions when window is positioned at (0, 0) In-Game: window_mouse_set() malfunctions when the game window is positioned at 0,0 Dec 3, 2024
@stuckie stuckie moved this from Triage to Backlog in Team Workload Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
project This issue has a sample project attached runner-bug In-game bugs with the "GameMaker Studio 2" runtimes
Projects
Status: Backlog
Development

No branches or pull requests

1 participant