We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 4401 - SDL_GetWindowPosition() wrong after SDL_SetWindowPosition() until window is moved on macOS
Summary: SDL_GetWindowPosition() wrong after SDL_SetWindowPosition() until window is m...
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: HG 2.0
Hardware: x86_64 macOS 10.13
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords: target-2.0.10
Depends on:
Blocks:
 
Reported: 2018-11-28 22:37 UTC by Michel Rouzic
Modified: 2019-05-19 18:52 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michel Rouzic 2018-11-28 22:37:33 UTC
After I initialise my window I call SDL_SetWindowPosition() to move the window to an arbitrary position. The problem is that if the requested position isn't the actual position, for instance I set it to (0, 26) or even (0, 0) but the actual position due to the title bar and menu bar is (0, 45) then SDL_GetWindowPosition() will insist on giving me the position I set rather than the actual position, that is until the user moves the window, then SDL_GetWindowPosition() will return valid positions. It's as if SDL doesn't check the actual window position after attempting to set it to the given values.

It happens with a fresh hg clone on macOS 10.14.1 with Xcode 10.1. The window is initialised with the flags SDL_WINDOW_OPENGL | SDL_WINDOW_RESIZABLE.
Comment 1 Ryan C. Gordon 2019-05-18 18:48:55 UTC
Tagging a bunch of bugs with "target-2.0.10" so we have a clear list of things to address before a 2.0.10 release.

Please note that "addressing" one of these bugs might mean deciding to defer on it until after 2.0.10, or resolving it as WONTFIX, etc. This is just here to tell us we should look at it carefully, and soon.

If you have new information or feedback on this issue, this is a good time to add it to the conversation, as we're likely to be paying attention to this specific report in the next few days/weeks.

Thanks!

--ryan.
Comment 2 Sam Lantinga 2019-05-19 18:52:44 UTC
Fixed, thanks!
https://hg.libsdl.org/SDL/rev/d3421eeb57a0