| Summary: | iOS landscape orientation bugs with iOS 10.x and iPhone 6 | ||
|---|---|---|---|
| Product: | SDL | Reporter: | philhassey <phil> |
| Component: | video | Assignee: | Alex Szpakowski <amaranth72> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | frankinshtein85, phil |
| Version: | 2.0.5 | Keywords: | target-2.0.6 |
| Hardware: | iPhone/iPod touch | ||
| OS: | iOS (All) | ||
| Attachments: |
You can see in this shot how the window is being created in a "portrait" size on a "landscape" screen.
Patch / replacement for UIKit_ComputeViewFrame in SDL_uikitvideo.m |
||
Created attachment 2645 [details]
Patch / replacement for UIKit_ComputeViewFrame in SDL_uikitvideo.m
could be related with https://bugzilla.libsdl.org/show_bug.cgi?id=3465 Alex, can you look at this for the 2.0.6 release? I believe I've fixed it / worked around the problem with https://hg.libsdl.org/SDL/rev/770196e01af1 , can you confirm? This seems to be fixed in 2.0.6. Thanks! Will report back if I hear otherwise from users. |
Created attachment 2644 [details] You can see in this shot how the window is being created in a "portrait" size on a "landscape" screen. If you create a landscape only app, the following steps will cause the screen size to break. This happens on iPhone 6's with iOS 10.x. It does not seem to impact iPads with iOS 10.x - Create your app using proper start up screens, orientation hints, full screen, resize disabled, border disabled. - Start your app - Hold your phone in landscape orientation - Put your phone into sleep mode - Hold your phone in portrait orientation - Unlock your phone to resume the app - You'll see the app window is re-created incorrectly I did a lot of digging, and it seems that as of iOS 8 the recommended way to get the window size has changed again. When the app resumes, it makes a call to UIKit_ComputeViewFrame at some point which sometimes gives strange results using the current method. Sometimes the bounds are not what they are expected to be. I've attached a new version of that function which resolved the issue for me, and I've given it some testing on both a "all orientations" game as well as a "landscape-only" game, on both iPads and an iPhone 6. I'm not 100% certain if I've correctly handled all of the SDL or iOS specifics in my replacement function, so I'd appreciate any review / help in getting a finalized patch here. I've also attached a screenshot showing what happens to my game in the above steps. Thanks! -Phil