layout: fix a few keyboard show/hide bugs

https://bugzilla.gnome.org/show_bug.cgi?id=657986
This commit is contained in:
Dan Winship 2011-09-01 11:35:25 -04:00
parent bf0bcaa306
commit d99f08b9c4

View File

@ -46,6 +46,7 @@ LayoutManager.prototype = {
this._bottomBox = new St.BoxLayout({ name: 'bottomBox', this._bottomBox = new St.BoxLayout({ name: 'bottomBox',
vertical: true }); vertical: true });
this.addChrome(this._bottomBox, { visibleInFullscreen: true }); this.addChrome(this._bottomBox, { visibleInFullscreen: true });
this._keyboardHeightNotifyId = 0;
this.trayBox = new St.BoxLayout({ name: 'trayBox' }); this.trayBox = new St.BoxLayout({ name: 'trayBox' });
this.trayBox.connect('allocation-changed', this.trayBox.connect('allocation-changed',
@ -283,18 +284,22 @@ LayoutManager.prototype = {
// anchor point changes // anchor point changes
this._chrome.updateRegions(); this._chrome.updateRegions();
this._bottomBox.connect('notify::height', Lang.bind(this, function () { this._keyboardHeightNotifyId = this._bottomBox.connect('notify::height', Lang.bind(this, function () {
this._bottomBoxAnchor = this._bottomBox.height; this._bottomBox.anchor_y = this._bottomBox.height;
})); }));
}, },
hideKeyboard: function (immediate) { hideKeyboard: function (immediate) {
Main.messageTray.hide(); Main.messageTray.hide();
if (this._keyboardHeightNotifyId) {
this._bottomBox.disconnect(this._keyboardHeightNotifyId);
this._keyboardHeightNotifyId = 0;
}
Tweener.addTween(this._bottomBox, Tweener.addTween(this._bottomBox,
{ anchor_y: 0, { anchor_y: 0,
time: immediate ? 0 : KEYBOARD_ANIMATION_TIME, time: immediate ? 0 : KEYBOARD_ANIMATION_TIME,
transition: 'easeOutQuad', transition: 'easeOutQuad',
onComplete: this._showKeyboardComplete, onComplete: this._hideKeyboardComplete,
onCompleteScope: this onCompleteScope: this
}); });
}, },