Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Split screen multitasking startup resolution problems

Discussion in 'iOS and tvOS' started by lostminds, Mar 10, 2020.

  1. lostminds

    lostminds

    Joined:
    Jan 17, 2019
    Posts:
    51
    I'm working on a little utility/plaything in Unity 2019.3.4 and I thought I'd try to get it to support Split screen multitasking on iOS so users could have it beside some other app (like messages, facebook or whatever). It was easy enough to just uncheck the "Requires fullscreen" option in the project settings and I can now add the app as a second split screen view on iOS.

    However, I'm having problems with the resolution. If I start the app normally in fullscreen and then add it as a secondary split view app this works more or less fine, just like a resolution/orientation change when it's moved to the split view (though it seems to mess up Screen.orientation and Input.deviceOrientation). However, it I don't have the app running and it's started by adding it as a secondary split screen app the resolution seems to be scaled incorrectly and I'm getting a weird offset of everything on screen with half of it black. These scaling and offset problems are then retained even if the app is scaled back to full screen, so it seems like something is going wrong during startup the app can't recover from.

    Has anyone encountered similar problems with starting a unity app in a split screen view? Any guesses or advice on how to get around it?
     
  2. VoxelMatt

    VoxelMatt

    Joined:
    Apr 22, 2015
    Posts:
    42
    A similar problem still exists in Unity 2021.3.6f1.

    When in iPad Split View if you change `Screen.orientation` the rendering view goes half black - and stays broken regardless of leaving or changeing split view or changing the orientation.

    In fact once it's broken - if you change the orientation by rotating the device you can 'step' the rendered window further and further away.

    This happens in an empty project if you have "Requires Fullscreen" set to false. And you set the Screen.orientation at any time in code while using iPad Split View.

    I've created a bug report IN-10208
     
  3. Alexey

    Alexey

    Unity Technologies

    Joined:
    May 10, 2010
    Posts:
    1,623
    Yes, we have seen the issue and the fix (along with backports) is in the works. You can fix it locally by going to
    Classes/UI/UnityAppController+ViewHandling.mm
    in the trampoline, searching for the
    Code (csharp):
    1. - (void)transitionToViewController:(UIViewController*)vc
    and commenting out (or removing) these lines

    Code (csharp):
    1. _window.bounds = [UIScreen mainScreen].bounds;
    2. // required for iOS 8, otherwise view bounds will be incorrect
    3. _rootView.bounds = _window.bounds;
    4. _rootView.center = _window.center;