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 3465

Summary: iOS. OpenGLES2. Something weird with window size after power button off -> on
Product: SDL Reporter: dmuratshin <frankinshtein85>
Component: videoAssignee: Alex Szpakowski <amaranth72>
Status: WAITING --- QA Contact: Sam Lantinga <slouken>
Severity: critical    
Priority: P2 CC: amaranth72, frankinshtein85
Version: HG 2.1Keywords: target-2.0.6
Hardware: iPhone/iPod touch   
OS: Other   

Description dmuratshin 2016-10-22 13:26:06 UTC
After updating to iOS 10 "SDL_GL_GetDrawableSize" returns wrong size when you switch display Off and then On
for example on my iPhone 5 in Landscape mode it returns (144, 1632) and (640, 1136)
instead off (1136, 640).

iOS 7/8/9 works fine as expected and always returns (1136, 640)
Comment 1 dmuratshin 2016-10-22 13:46:56 UTC
more info
flags:
            int flags = SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN;
            flags |= SDL_WINDOW_BORDERLESS;
            flags |= SDL_WINDOW_ALLOW_HIGHDPI;
            flags |= SDL_WINDOW_FULLSCREEN;

main loop via:
    SDL_iPhoneSetAnimationCallback
Comment 2 dmuratshin 2016-10-22 14:05:52 UTC
ok, after some investigation I've found key
bug reproducible only if you use SDL_iPhoneSetAnimationCallback instead of common main loop
Comment 3 Alex Szpakowski 2016-10-22 14:34:36 UTC
Can you provide a minimal test case that reproduces the issue?
Comment 4 dmuratshin 2016-10-22 22:11:23 UTC
https://github.com/oxygine/SDL2/commit/e22853e5ce3ebe35ed13b23b1cd2d06814933fdf
minimum changes.
I've found that it happens only in pair with SDL_WINDOW_FULLSCREEN flag
Comment 5 dmuratshin 2016-10-26 21:23:24 UTC
Do you need any assist? Or maybe you expect directly attached files?
Comment 6 dmuratshin 2017-04-26 15:46:46 UTC
how to reproduce video:
https://goo.gl/photos/iCCdsQJa7FWXuZyP7
Comment 7 Sam Lantinga 2017-08-11 20:13:36 UTC
Alex, can you look at this for the 2.0.6 release?
Comment 8 dmuratshin 2017-08-12 13:02:02 UTC
update:
it is not ios 10 only. Could be reproduced with 8/9 too.
happens with SDL_iPhoneSetAnimationCallback.

how to repro (see video above):

0. launch landscape app
1. open/close any native UI in game (keyboard, facebook login etc)
2. rotate display to portrait mode
3. turn display off
4. turn on
5. try to open any native UI
result -> broken background size
Comment 9 Alex Szpakowski 2017-08-19 02:25:42 UTC
I believe I've fixed it / worked around the problem with https://hg.libsdl.org/SDL/rev/770196e01af1 , can you confirm?
Comment 10 dmuratshin 2017-08-29 14:28:03 UTC
Still not fixed
proof:
https://goo.gl/photos/RffZqHBG3LKCVNXS7

please note
1. SDL_iPhoneSetAnimationCallback should be used
2. FULLSCREEN BORDERLESS mode
3. UIKit_ComputeViewFrame called only on start
4. native UI should be opened before bug occures
Comment 11 dmuratshin 2017-08-29 14:31:16 UTC
5. iphone (not ipad)
Comment 12 Alex Szpakowski 2017-08-29 15:14:02 UTC
Is it still reproducible when using SDL's native virtual keyboard rather than a third party / other native UI? If not, the problem may not be fixable on SDL's end as it's likely a bug in iOS or the third party UI.
Comment 13 Alex Szpakowski 2017-09-20 15:03:23 UTC
iOS 11 may have fixed the underlying issue, as well.