We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 1578 - Window/View is not correctly updated when device rotates
Summary: Window/View is not correctly updated when device rotates
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: HG 2.0
Hardware: iPhone/iPod touch All
: P1 major
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords: target-2.0.0
Depends on:
Blocks:
 
Reported: 2012-08-24 09:40 UTC by onaips
Modified: 2015-04-10 02:46 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description onaips 2012-08-24 09:40:24 UTC
$This is happening for status bar enabled (i.e. no fullscreen/no borderless) apps.$

When rotating the iOS device from the original position, the "didRotateFromInterfaceOrientation" member function is called (SDL_uikitviewcontroller.m), which updates all coordinate related variables in order to account for the rotation.



However, there is a bug concerning the frame update of the correspondent uiwindow/frame, which causes the ios screen to chop the first 20/40 pixels (retina/non-retina) of the sdl window.
This is happening because the following code is inserting a 20/40px margin on both uiwindow and data->view.

[uiwindow setFrame:frame];
[data->view setFrame:frame];

To fix it, one just apply null origin on frame, i.e. reset the frame margins (frame.origin.x/y) to zero.

[uiwindow setFrame:frame];
frame.origin = CGPointZero;
[data->view setFrame:frame];
Comment 1 Ryan C. Gordon 2013-07-12 18:52:40 UTC
(Sorry if you get a lot of copies of this email, we're touching dozens of bug reports right now.)

Tagging a bunch of bugs as target-2.0.0, Priority 1.

This means we're in the final stretch for an official SDL 2.0.0 release! These are the bugs we really want to fix before shipping if humanly possible.

That being said, we don't promise to fix them because of this tag, we just want to make sure we don't forget to deal with them before we bless a final 2.0.0 release, and generally be organized about what we're aiming to ship.

Hopefully you'll hear more about this bug soon. If you have more information (including "this got fixed at some point, nevermind"), we would love to have you come add more information to the bug report when you have a moment.

Thanks!
--ryan.
Comment 2 Ryan C. Gordon 2015-04-10 02:46:29 UTC
This bug should be fixed by the changes made for Bug #2798. Please reopen if that's not the case.

Thanks!

--ryan.