| Summary: | Number of screens don't get updated | ||
|---|---|---|---|
| Product: | SDL | Reporter: | bugzilla |
| Component: | video | Assignee: | Ryan C. Gordon <icculus> |
| Status: | ASSIGNED --- | QA Contact: | Sam Lantinga <slouken> |
| Severity: | major | ||
| Priority: | P2 | CC: | icculus |
| Version: | 2.0.10 | Keywords: | target-2.0.16 |
| Hardware: | x86_64 | ||
| OS: | Windows (All) | ||
| Attachments: | Possible fix, kinda hacky. | ||
Do you need any additional details for this? My concern is that we probably can't change this until we break ABI in 2.1, since GetNumVideoDisplays can't change if an app is in the middle of using it. But I have to think through this more (including if we should _actually_ be concerned in 2.0 about a race condition on the extraordinary event of display setup changing). We definitely shouldn't just pretend there's a 720p display there if one suddenly vanishes. --ryan. I think it's okay for us to change the number of displays and not worry about the race condition for now, as long as we cleanly return an error if we're passed a newly invalid index (which I think we do right now) I'm going to bump this to 2.0.16. It's worth doing, but it's more involved than I want to mess with for this release. |
Created attachment 4156 [details] Possible fix, kinda hacky. Overview: When adding or removing a display SDL_GetNumVideoDisplays() doesn't change the number of displays, also resolutions don't change. Steps to Reproduce: 1) Initialize the SDL System 2) SDL_GetNumVideoDisplays(); will return the active number of displays 3) Add or remove a display 4) Call SDL_GetNumVideoDisplays(); Actual Results: It will still have the same number of displays in step 2 as in step 4 Expected Results: It will have the new number of displays Build Date & Hardware: SDL2-2.0.10-win32-x64.zip and windows 10. Additional Builds and Platforms: Same happens for 32 bit, and all other windows versions Additional Information: Windows has an WindowProc message called WM_DISPLAYCHANGE to handle this. Added is a patch that will fix it, but it's not clean, but we can't just remove all displays and then re-add them since SDL will close all windows.