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

Fix autorotate behavior during launch on iOS #3098

Merged
merged 1 commit into from Oct 20, 2014

Conversation

prollin
Copy link
Contributor

@prollin prollin commented Oct 17, 2014

This could cause orientation issues when launching on iOS. Strangely it was working fine on iOS 8 but caused issues on the upcoming iOS 8.1 (I suspect this might be the cause for some ppl having orientation issues, depending on what they do in their Game.Initialize)

@prollin
Copy link
Contributor Author

prollin commented Oct 17, 2014

@totallyeviljake how is PresentationParameter.Clear() related to ShouldAutoRotate? Looking at the code I can't see how it would crash

@totallyeviljake
Copy link
Contributor

If you use the PresentationParameters() after you clear it, then it would give you an exception. It has an unexpected side effect. The iOS world is far more picky than any other platform, and we have very little access prior to the UI manager affecting its changes..... so, this is not a problem for your to fix Philippe - it's mostly something to know about MonoGame on iOS.

@picobots
Copy link
Contributor

@prollin Can you explain what you mean by "could cause orientation issues when launching on iOS"? What specifically happens? And are you using Xcode 6.1? iOS 8.1 Simulator? iOS 8.1 Beta on a real device?

@totallyeviljake I'm confused by what you're saying. Are you saying that changing this line of code causes a new potential issue on iOS?

@prollin
Copy link
Contributor Author

prollin commented Oct 19, 2014

@picobots prior to this fix, ShouldAutoRotate would return false until Game.IsInitialized is true. For our case, a Landscape game, it resulted in incorrect framebuffer orientation (width and height seemed reversed) if starting the game when the device was in portrait (or the other landscape mode).
It seemed to be working prior to the latest iOS 8.1 GM seed though.
In any case it seems valid to always want ShouldAutorotate to return true and only rely on the SupportedOrientations set by the user.

There are most likely other issues with iOS orientations, this fix is most likely not the root cause of the other stuff that is happening.

@tomspilman
Copy link
Member

Ok... i'll merge this for now. We'll look for the other sources the bug from here.

tomspilman added a commit that referenced this pull request Oct 20, 2014
Fix autorotate behavior during launch on iOS
@tomspilman tomspilman merged commit 4869339 into MonoGame:develop Oct 20, 2014
@prollin prollin deleted the FixAutoRotateIOS branch November 21, 2014 18:47
@Nezz Nezz mentioned this pull request Dec 13, 2014
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

Successfully merging this pull request may close these issues.

None yet

6 participants