Skip to content

Cocoa_GetDisplayUsableBounds: Remove SDL_assert? #6502

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

past-due
Copy link
Contributor

@past-due past-due commented Nov 8, 2022

I'm not entirely sure why this SDL_assert call is here (possibly left-over from some debugging?), but this is getting triggered on my test system - despite the fact that the parent SDL calls handle a failure return code from Cocoa_GetDisplayUsableBounds properly. (And the public SDL_GetDisplayUsableBounds function also returns success / failure.)

Regardless of why this assert is getting hit, it doesn't seem like there should be an assert here, given everything that calls this is supposed to handle success / failure or return a success / failure value?

@slouken
Copy link
Collaborator

slouken commented Nov 8, 2022

Can you debug into it and find out why the display can't be found?

@icculus
Copy link
Collaborator

icculus commented Nov 9, 2022

I don't know why this is failing, but that assert is there because the heuristic is flaky and we wanted to know if/when it failed, so it did its job.

Is there anything unusual about your configuration? I'd like to know if screens was nil, or what thisDisplay was for each iteration vs cgdisplay.

Also, as the FIXME notes: we should just figure out the NSScreen when starting out, so we don't have this loop at all, which would also solve the problem.

@past-due
Copy link
Contributor Author

past-due commented Nov 9, 2022

I don't know why this is failing, but that assert is there because the heuristic is flaky and we wanted to know if/when it failed, so it did its job.

Is there anything unusual about your configuration? I'd like to know if screens was nil, or what thisDisplay was for each iteration vs cgdisplay.

I believe this was around the time the window was being transitioned (or had just transitioned?) from fullscreen to windowed.

Will be a bit before I have a chance to debug further, but it was pretty consistent on an (old) test system with macOS 10.15.

@slouken slouken added the waiting Waiting on user response label Nov 23, 2022
@past-due past-due marked this pull request as draft November 23, 2022 22:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting Waiting on user response
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants