From c04f7919c1f751d00cf7ae3f52bfa6dfabdcb6e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20L=C3=BCbking?= Date: Sat, 7 Nov 2015 21:51:59 +0100 Subject: [PATCH] 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 --- .../maximize/package/contents/code/maximize.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/effects/maximize/package/contents/code/maximize.js b/effects/maximize/package/contents/code/maximize.js index 3077ad4125..d381a68102 100644 --- a/effects/maximize/package/contents/code/maximize.js +++ b/effects/maximize/package/contents/code/maximize.js @@ -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; },