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

SDL_SetWindowPosition does not respect the display passed in for SDL_WINDOWPOS_CENTERED_DISPLAY(?) #1745

Closed
SDLBugzilla opened this issue Feb 10, 2021 · 0 comments

Comments

@SDLBugzilla
Copy link
Collaborator

This bug report was migrated from our old Bugzilla tracker.

These attachments are available in the static archive:

Reported in version: HG 2.0
Reported for operating system, platform: Other, x86

Comments on the original bug report:

On 2015-01-19 17:46:48 +0000, Edward Rudd wrote:

Created attachment 1995
Patch to fix the SetWindowPosition behvior

When I run this SDL code

SDL_SetWindowPosition(sdlWin, SDL_WINDOWPOS_CENTERED_DISPLAY(1), SDL_WINDOWPOS_CENTERED_DISPLAY(1));

I expect the window to 'move' from the first screen to the second screen. However it doesn't as the SetWindowPosition code only looks at where the window currently is to determine the display index.

a side-effect of this change would be that if some existing code assumed that this code

SDL_SetWindowPosition(sdlWin, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED);

would center the window on the current monitor, would start to not work as expected. (it would always center on the first monitor)

However, that is undocumented behaviour, and I believe this patch implements the correct expected behavior of this method.

On 2015-02-11 18:59:39 +0000, Edward Rudd wrote:

Created attachment 2029
updated patch to be C90 compliant.

On 2015-02-19 05:22:15 +0000, Ryan C. Gordon wrote:

Marking a large number of bugs with the "triage-2.0.4" keyword at once. Sorry if you got a lot of email from this. This is to help me sort through some bugs in regards to a 2.0.4 release. We may or may not fix this bug for 2.0.4, though!

On 2015-02-20 00:42:03 +0000, Ryan C. Gordon wrote:

This patch is now https://hg.libsdl.org/SDL/rev/c9a4d606f6db, thanks!

--ryan.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant