Code review comment for lp://staging/~nick-dedekind/unity8/sidestage-restoreOnRotation

Revision history for this message
Nick Dedekind (nick-dedekind) wrote :

> Nice refactoring in tst_TabletStage.
>
> -----------
>
> This sure is the easiest way to fix that bug, but I think it's wasteful to
> keep updating a database on disk (IO) about information you already keep in a
> variable in RAM. You only need to write that info to disk once the application
> goes away, as you are no longer keeping tabs on it in RAM.

This is really a performance problem with the WindowStateStorage component.
We could make it batch state changes, or only save to disk out on exit; but that's for a different MP.

>
> Why does it lose that information when you rotate the shell?

When we rotate to and from portrait, the sidestage enables/disables (because sidestage not available in portrait). This triggers a refresh of the last saved stage (ie the last one due to user interaction [ie. dragging or closing]).

1) First open app.
   - MainStage loaded as default.
2) Drag app to SideStage.
   - state saved to SideStage.
3) Rotate device to portrait
   - App switches to MainStage because that's all that is available
4) Rotate device back to landscape
   - Reload saved stage = SideStage.

So if we drop on SideStage, then flip to portrait it will load in MainStage because SideStage is not available, but flip back to landscape and it will reload the last dropped stage (SideStage)

>
> What will happen if an application has two surfaces (one in main and one in
> side stage) and you rotate to portrait and then back to landscape
> (tst_OrientedShell doesn't have yet those app list controls so I could easily
> reproduce this use case)?

We'll have to have stage saved/loaded per surface. For another MP.

« Back to merge proposal