~aacid/unity8/quicklist_selection_tuning

« back to all changes in this revision

Viewing changes to qml/Stage/StagedFullscreenPolicy.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:
28
28
QtObject {
29
29
    property bool active: true
30
30
 
 
31
    function applyPolicy(surfaceState, surfaceChrome) {
 
32
        if (surfaceChrome === Mir.LowChrome) {
 
33
            return Mir.FullscreenState;
 
34
        }
 
35
        return surfaceState;
 
36
    }
 
37
 
31
38
    property var surface: null
32
 
    onSurfaceChanged: {
33
 
        if (!active || !surface) return;
34
 
        if (surface.shellChrome === Mir.LowChrome) {
35
 
            surface.requestState(Mir.FullscreenState);
36
 
        }
37
 
    }
38
 
 
39
39
    property var _connections: Connections {
40
40
        target: surface
41
41
        onShellChromeChanged: {
46
46
                surface.requestState(Mir.RestoredState);
47
47
            }
48
48
        }
49
 
        onStateChanged: {
50
 
            if (!active) return;
51
 
            if (surface.state === Mir.RestoredState && surface.shellChrome === Mir.LowChrome) {
52
 
                surface.requestState(Mir.FullscreenState);
53
 
            }
54
 
        }
55
49
    }
56
50
}