[gnome-shell] layout: fix initial struts
- From: Dan Winship <danw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] layout: fix initial struts
- Date: Tue, 6 Sep 2011 18:32:59 +0000 (UTC)
commit bf0bcaa30635c3af7cce9c7586654ba202dea2bd
Author: Dan Winship <danw gnome org>
Date: Fri Sep 2 16:36:02 2011 -0400
layout: fix initial struts
The struts were being set while the panel was offscreen (starting its
slide-in animation), and then belatedly getting fixed the next time
something else caused a chrome update. Fix this by setting them before
the animation, and freezing them during the animation.
https://bugzilla.gnome.org/show_bug.cgi?id=657986
js/ui/layout.js | 26 ++++++++++++++++++++++++--
1 files changed, 24 insertions(+), 2 deletions(-)
---
diff --git a/js/ui/layout.js b/js/ui/layout.js
index b03b7ab..a3fd4e1 100644
--- a/js/ui/layout.js
+++ b/js/ui/layout.js
@@ -250,14 +250,23 @@ LayoutManager.prototype = {
},
_startupAnimation: function() {
+ // Don't animate the strut
+ this._chrome.freezeUpdateRegions();
+
this.panelBox.anchor_y = this.panelBox.height;
Tweener.addTween(this.panelBox,
{ anchor_y: 0,
time: STARTUP_ANIMATION_TIME,
- transition: 'easeOutQuad'
+ transition: 'easeOutQuad',
+ onComplete: this._startupAnimationComplete,
+ onCompleteScope: this
});
},
+ _startupAnimationComplete: function() {
+ this._chrome.thawUpdateRegions();
+ },
+
showKeyboard: function () {
Main.messageTray.hide();
Tweener.addTween(this._bottomBox,
@@ -549,6 +558,8 @@ Chrome.prototype = {
this._monitors = [];
this._inOverview = false;
+ this._updateRegionIdle = 0;
+ this._freezeUpdateCount = 0;
this._trackedActors = [];
@@ -744,11 +755,22 @@ Chrome.prototype = {
},
_queueUpdateRegions: function() {
- if (!this._updateRegionIdle)
+ if (!this._updateRegionIdle && !this._freezeUpdateCount)
this._updateRegionIdle = Mainloop.idle_add(Lang.bind(this, this.updateRegions),
Meta.PRIORITY_BEFORE_REDRAW);
},
+ freezeUpdateRegions: function() {
+ if (this._updateRegionIdle)
+ this.updateRegions();
+ this._freezeUpdateCount++;
+ },
+
+ thawUpdateRegions: function() {
+ this._freezeUpdateCount--;
+ this._queueUpdateRegions();
+ },
+
_updateFullscreen: function() {
let windows = Main.getWindowActorsForWorkspace(global.screen.get_active_workspace_index());
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]