~aacid/unity8/quicklist_selection_tuning

« back to all changes in this revision

Viewing changes to qml/Stage/WindowedFullscreenPolicy.qml

  • Committer: Bileto Bot
  • Author(s): Lukáš Tinkl
  • Date: 2017-03-08 09:50:45 UTC
  • mfrom: (2833.1.18 fix-shell-chrome)
  • Revision ID: ci-train-bot@canonical.com-20170308095045-hu525md77z06pz02
Shell chrome fixes

Correctly save and load the window state from storage, do not restore our QML window right away but queue the state, filter it with the shell chrome policy (when in windowed mode) later on, and then apply it at altogether, once the surface creation is settled.

For a more elegant longterm fix, we should probably introduce "initialSurfaceState" in qtmir, much like the recent "initialSurfaceSize" so that the window/surface gets the correct state right from the beginning. (LP: #1658117, #1665723, #1665724, #1669010)

Approved by: Michael Zanetti, Unity8 CI Bot

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
// On first surface load; if the surface is set to low chrome & fullscreen, the
23
23
// state of the window is returned to restored.
24
24
QtObject {
25
 
    property bool active: true
26
 
    property QtObject surface: null
27
 
 
28
 
    property bool _firstTimeSurface: true
29
 
 
30
 
    onSurfaceChanged: {
31
 
        if (!active || !surface) return;
32
 
        if (!_firstTimeSurface) return;
33
 
        _firstTimeSurface = false;
34
 
 
35
 
        if (surface.state === Mir.FullscreenState && surface.shellChrome === Mir.LowChrome) {
36
 
            surface.requestState(Mir.RestoredState);
 
25
    function applyPolicy(surfaceState, surfaceChrome) {
 
26
        if (surfaceState === Mir.FullscreenState && surfaceChrome === Mir.LowChrome) {
 
27
            return Mir.RestoredState;
37
28
        }
 
29
        return surfaceState;
38
30
    }
39
31
}