File tree Expand file tree Collapse file tree
Ports/iOSPort/nativeSources Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -218,7 +218,16 @@ - (void)cn1ApplicationWillEnterForeground
218218 com_codename1_impl_ios_IOSImplementation_applicationWillEnterForeground__ (CN1_THREAD_GET_STATE_PASS_SINGLE_ARG);
219219 CodenameOne_GLViewController* vc = [CodenameOne_GLViewController instance ];
220220 if (vc != nil ) {
221- [vc updateCanvas: YES ];
221+ // Defer updateCanvas by one run-loop cycle so that UIKit has a chance to
222+ // settle the root view bounds after foreground transition. Calling this
223+ // too early can report the short edge for width/height on iPad, which
224+ // causes a transient wrong screen-size event between stop/start.
225+ dispatch_async (dispatch_get_main_queue (), ^{
226+ CodenameOne_GLViewController* deferredVc = [CodenameOne_GLViewController instance ];
227+ if (deferredVc != nil ) {
228+ [deferredVc updateCanvas: YES ];
229+ }
230+ });
222231 }
223232}
224233
You can’t perform that action at this time.
0 commit comments