on xenial help sign in
delay alt-tab for a bit to avoid flickering on quick alt+tabs
commit45a7132c8833cd8addc93e333900d9a065092efe authorMichael Zanetti <michael.zanetti@canonical.com> dateWed 26 Oct 2016, 14:13 (10 years ago) parent3863244
1 file changed+26−1
qml/Stage/Stage.qml+26−1
qml/Stage/Stage.qml+26−1
@@ -90,7 +90,32 @@ FocusScope {
9090 }
9191
9292
93− onAltTabPressedChanged: priv.goneToSpread = altTabPressed
93+ onAltTabPressedChanged: {
94+ if (altTabPressed) {
95+ altTabDelayTimer.start();
96+ } else {
97+ // Alt Tab has been released, did we already go to spread?
98+ if (priv.goneToSpread) {
99+ priv.goneToSpread = false;
100+ } else {
101+ // No we didn't, do a quick alt-tab
102+ if (appRepeater.count > 1) {
103+ appRepeater.itemAt(1).claimFocus();
104+ }
105+ }
106+ }
107+ }
108+
109+ Timer {
110+ id: altTabDelayTimer
111+ interval: 140
112+ repeat: false
113+ onTriggered: {
114+ if (root.altTabPressed) {
115+ priv.goneToSpread = true;
116+ }
117+ }
118+ }
94119
95120 property Item itemConfiningMouseCursor: !spreadShown && priv.focusedAppDelegate && priv.focusedAppDelegate.surface &&
96121 priv.focusedAppDelegate.surface.confinesMousePointer ?