abort max animation on unrelated geometry changes

stupid clients think it's relevant to withdraw other states
when going fullscreen, this means we trigger an
nmaximization animation and when that's done, the
window is fullscreen...

Unfortunately one of the stupid clients is QWidget and also
the window could get other, *legit*, resizes during the
animation, so we cancel it on occasion

BUG: 336467
FIXED-IN: 5.5
REVIEW: 125989
This commit is contained in:
Thomas Lübking 2015-11-07 21:51:59 +01:00
parent 8bea96d701
commit c04f7919c1

View file

@ -35,7 +35,7 @@ var maximizeEffect = {
oldGeometry = window.olderGeometry;
window.olderGeometry = window.oldGeometry;
window.oldGeometry = newGeometry;
animate({
window.maximizeAnimation1 = animate({
window: window,
duration: maximizeEffect.duration,
animations: [{
@ -61,7 +61,7 @@ var maximizeEffect = {
}]
});
if (!window.resize) {
animate({
window.maximizeAnimation2 =animate({
window: window,
duration: maximizeEffect.duration,
animations: [{
@ -74,6 +74,17 @@ var maximizeEffect = {
},
geometryChange: function (window, oldGeometry) {
"use strict";
if (window.maximizeAnimation1) {
if (window.geometry.width != window.oldGeometry.width ||
window.geometry.height != window.oldGeometry.height) {
cancel(window.maximizeAnimation1);
delete window.maximizeAnimation1;
if (window.maximizeAnimation2) {
cancel(window.maximizeAnimation2);
delete window.maximizeAnimation2;
}
}
}
window.oldGeometry = window.geometry;
window.olderGeometry = oldGeometry;
},