Changeset View
Changeset View
Standalone View
Standalone View
effects/maximize/package/contents/code/maximize.js
Show All 13 Lines | |||||
14 | GNU General Public License for more details. | 14 | GNU General Public License for more details. | ||
15 | 15 | | |||
16 | You should have received a copy of the GNU General Public License | 16 | You should have received a copy of the GNU General Public License | ||
17 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 17 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
18 | *********************************************************************/ | 18 | *********************************************************************/ | ||
19 | /*global effect, effects, animate, animationTime, Effect*/ | 19 | /*global effect, effects, animate, animationTime, Effect*/ | ||
20 | var maximizeEffect = { | 20 | var maximizeEffect = { | ||
21 | duration: animationTime(250), | 21 | duration: animationTime(250), | ||
22 | windowForceBlurRoleState: false, | ||||
22 | loadConfig: function () { | 23 | loadConfig: function () { | ||
23 | "use strict"; | 24 | "use strict"; | ||
24 | maximizeEffect.duration = animationTime(250); | 25 | maximizeEffect.duration = animationTime(250); | ||
25 | }, | 26 | }, | ||
26 | maximizeChanged: function (window) { | 27 | maximizeChanged: function (window) { | ||
27 | "use strict"; | 28 | "use strict"; | ||
28 | if (!window.oldGeometry) { | 29 | if (!window.oldGeometry) { | ||
29 | return; | 30 | return; | ||
30 | } | 31 | } | ||
32 | maximizeEffect.windowForceBlurRoleState = window.data(5); | ||||
33 | window.setData(5, true); | ||||
31 | var oldGeometry, newGeometry; | 34 | var oldGeometry, newGeometry; | ||
32 | oldGeometry = window.oldGeometry; | 35 | oldGeometry = window.oldGeometry; | ||
33 | newGeometry = window.geometry; | 36 | newGeometry = window.geometry; | ||
34 | if (oldGeometry.width == newGeometry.width && oldGeometry.height == newGeometry.height) | 37 | if (oldGeometry.width == newGeometry.width && oldGeometry.height == newGeometry.height) | ||
35 | oldGeometry = window.olderGeometry; | 38 | oldGeometry = window.olderGeometry; | ||
36 | window.olderGeometry = window.oldGeometry; | 39 | window.olderGeometry = window.oldGeometry; | ||
37 | window.oldGeometry = newGeometry; | 40 | window.oldGeometry = newGeometry; | ||
38 | window.maximizeAnimation1 = animate({ | 41 | window.maximizeAnimation1 = animate({ | ||
Show All 28 Lines | 67 | window.maximizeAnimation2 =animate({ | |||
67 | animations: [{ | 70 | animations: [{ | ||
68 | type: Effect.CrossFadePrevious, | 71 | type: Effect.CrossFadePrevious, | ||
69 | to: 1.0, | 72 | to: 1.0, | ||
70 | from: 0.0 | 73 | from: 0.0 | ||
71 | }] | 74 | }] | ||
72 | }); | 75 | }); | ||
73 | } | 76 | } | ||
74 | }, | 77 | }, | ||
78 | restoreForceBlurState: function(window) { | ||||
79 | window.setData(5, maximizeEffect.windowForceBlurRoleState); | ||||
80 | }, | ||||
75 | geometryChange: function (window, oldGeometry) { | 81 | geometryChange: function (window, oldGeometry) { | ||
76 | "use strict"; | 82 | "use strict"; | ||
77 | if (window.maximizeAnimation1) { | 83 | if (window.maximizeAnimation1) { | ||
78 | if (window.geometry.width != window.oldGeometry.width || | 84 | if (window.geometry.width != window.oldGeometry.width || | ||
79 | window.geometry.height != window.oldGeometry.height) { | 85 | window.geometry.height != window.oldGeometry.height) { | ||
80 | cancel(window.maximizeAnimation1); | 86 | cancel(window.maximizeAnimation1); | ||
81 | delete window.maximizeAnimation1; | 87 | delete window.maximizeAnimation1; | ||
82 | if (window.maximizeAnimation2) { | 88 | if (window.maximizeAnimation2) { | ||
83 | cancel(window.maximizeAnimation2); | 89 | cancel(window.maximizeAnimation2); | ||
84 | delete window.maximizeAnimation2; | 90 | delete window.maximizeAnimation2; | ||
85 | } | 91 | } | ||
86 | } | 92 | } | ||
87 | } | 93 | } | ||
88 | window.oldGeometry = window.geometry; | 94 | window.oldGeometry = window.geometry; | ||
89 | window.olderGeometry = oldGeometry; | 95 | window.olderGeometry = oldGeometry; | ||
90 | }, | 96 | }, | ||
91 | init: function () { | 97 | init: function () { | ||
92 | "use strict"; | 98 | "use strict"; | ||
93 | effect.configChanged.connect(maximizeEffect.loadConfig); | 99 | effect.configChanged.connect(maximizeEffect.loadConfig); | ||
94 | effects.windowGeometryShapeChanged.connect(maximizeEffect.geometryChange); | 100 | effects.windowGeometryShapeChanged.connect(maximizeEffect.geometryChange); | ||
95 | effects.windowMaximizedStateChanged.connect(maximizeEffect.maximizeChanged); | 101 | effects.windowMaximizedStateChanged.connect(maximizeEffect.maximizeChanged); | ||
102 | effect.animationEnded.connect(maximizeEffect.restoreForceBlurState); | ||||
96 | } | 103 | } | ||
97 | }; | 104 | }; | ||
98 | maximizeEffect.init(); | 105 | maximizeEffect.init(); |