store geometry trail & use the correct oldGeometry

geometryChanged is always executed before maximizeChanged, so we
store the last changed geometry (through regular resize - the current
geometry) and the second last one (used exclusively so far) which is
the old geometry we want to use if the geometry change was caused
by the maximize change

CCBUG: 335023

Forward port of 3c8506992d3a05daa3f0752cc0f5e844acf2a8e2 from kde-workspace
This commit is contained in:
Thomas Lübking 2014-05-29 23:52:40 +02:00 committed by Martin Gräßlin
parent 35bfec1511
commit dec218a444

View file

@ -31,6 +31,10 @@ var maximizeEffect = {
var oldGeometry, newGeometry;
oldGeometry = window.oldGeometry;
newGeometry = window.geometry;
if (oldGeometry.width == newGeometry.width && oldGeometry.height == newGeometry.height)
oldGeometry = window.olderGeometry;
window.olderGeometry = window.oldGeometry;
window.oldGeometry = newGeometry;
animate({
window: window,
duration: maximizeEffect.duration,
@ -63,7 +67,8 @@ var maximizeEffect = {
},
geometryChange: function (window, oldGeometry) {
"use strict";
window.oldGeometry = oldGeometry;
window.oldGeometry = window.geometry;
window.olderGeometry = oldGeometry;
},
init: function () {
"use strict";