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
This commit is contained in:
Dan Winship 2011-09-02 16:36:02 -04:00
parent a199c1290b
commit bf0bcaa306

View File

@ -250,14 +250,23 @@ LayoutManager.prototype = {
}, },
_startupAnimation: function() { _startupAnimation: function() {
// Don't animate the strut
this._chrome.freezeUpdateRegions();
this.panelBox.anchor_y = this.panelBox.height; this.panelBox.anchor_y = this.panelBox.height;
Tweener.addTween(this.panelBox, Tweener.addTween(this.panelBox,
{ anchor_y: 0, { anchor_y: 0,
time: STARTUP_ANIMATION_TIME, time: STARTUP_ANIMATION_TIME,
transition: 'easeOutQuad' transition: 'easeOutQuad',
onComplete: this._startupAnimationComplete,
onCompleteScope: this
}); });
}, },
_startupAnimationComplete: function() {
this._chrome.thawUpdateRegions();
},
showKeyboard: function () { showKeyboard: function () {
Main.messageTray.hide(); Main.messageTray.hide();
Tweener.addTween(this._bottomBox, Tweener.addTween(this._bottomBox,
@ -549,6 +558,8 @@ Chrome.prototype = {
this._monitors = []; this._monitors = [];
this._inOverview = false; this._inOverview = false;
this._updateRegionIdle = 0;
this._freezeUpdateCount = 0;
this._trackedActors = []; this._trackedActors = [];
@ -744,11 +755,22 @@ Chrome.prototype = {
}, },
_queueUpdateRegions: function() { _queueUpdateRegions: function() {
if (!this._updateRegionIdle) if (!this._updateRegionIdle && !this._freezeUpdateCount)
this._updateRegionIdle = Mainloop.idle_add(Lang.bind(this, this.updateRegions), this._updateRegionIdle = Mainloop.idle_add(Lang.bind(this, this.updateRegions),
Meta.PRIORITY_BEFORE_REDRAW); Meta.PRIORITY_BEFORE_REDRAW);
}, },
freezeUpdateRegions: function() {
if (this._updateRegionIdle)
this.updateRegions();
this._freezeUpdateCount++;
},
thawUpdateRegions: function() {
this._freezeUpdateCount--;
this._queueUpdateRegions();
},
_updateFullscreen: function() { _updateFullscreen: function() {
let windows = Main.getWindowActorsForWorkspace(global.screen.get_active_workspace_index()); let windows = Main.getWindowActorsForWorkspace(global.screen.get_active_workspace_index());