Skip to content

Fix scaled-after-non-scaled usage #2925

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

Merged
merged 1 commit into from
Jul 8, 2024
Merged

Fix scaled-after-non-scaled usage #2925

merged 1 commit into from
Jul 8, 2024

Conversation

ankith26
Copy link
Member

@ankith26 ankith26 commented Jun 14, 2024

this PR fixes #2737 and fixes #2376 (they are essentially the same issue).

Note that I couldn't reproduce the original issue on Ubuntu, however @zoldalma999 has tested this branch and reported that this fix has worked on windows. Would be nice if someone gave this a test on a mac as well.

Also worth mentioning that the fix only works for SDL 2.28.0+, but all the wheels we distribute are on 2.30.3 so this shouldn't be a big deal.

It was also mentioned in one of the linked issues that #2571 is also the same issue, but I don't think that's the case.

@ankith26 ankith26 requested a review from a team as a code owner June 14, 2024 15:06
@ankith26 ankith26 added display pygame.display bugfix PR that fixes bug labels Jun 14, 2024
Copy link
Member

@zoldalma999 zoldalma999 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As Anktith said, this works for me with SDL 2.30.2, with the original reproducer.

@ankith26 ankith26 force-pushed the ankith26-display-setmode branch 2 times, most recently from 114ca2d to 22d5656 Compare June 17, 2024 17:13
@ankith26
Copy link
Member Author

A bit of interesting history: these new API functions were basically added for us by the SDL folks in response to issue #2190 so we have to make use of it!

@ankith26 ankith26 force-pushed the ankith26-display-setmode branch from 22d5656 to 1434bd4 Compare June 25, 2024 11:07
@rethanon
Copy link
Contributor

This does seem to fix #2737 but doesn't appear to fix #2376. I tested it today and the error still happens on my Mac (but is fixed on my Windows 11 machine)

@ankith26
Copy link
Member Author

ankith26 commented Jun 29, 2024

It doesn't fix #2376 as of now, but SDL has patched the underlying issue and the fix should be available in the next SDL bump, so let this PR wait for that

@ankith26 ankith26 force-pushed the ankith26-display-setmode branch from 1084774 to 61ed0ec Compare July 4, 2024 06:36
@ankith26
Copy link
Member Author

ankith26 commented Jul 4, 2024

After the latest rebase, this PR should fix the issue on mac as well.

@rethanon
Copy link
Contributor

rethanon commented Jul 4, 2024

Tested on my Mac (reminder it's a 2015 Intel based MacBook Pro) and yes indeed the tests were successful with the latest PR, thanks!

@ankith26 ankith26 added this to the 2.5.1 milestone Jul 8, 2024
Copy link
Member

@damusss damusss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code addition makes sense to me and the users reported the issue being fixed :)

@damusss damusss merged commit 85967e2 into main Jul 8, 2024
39 checks passed
@ankith26 ankith26 deleted the ankith26-display-setmode branch July 8, 2024 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix PR that fixes bug display pygame.display
Projects
None yet
5 participants