viewSelector: block show apps button checked signal when resetting state

When we reset the state of the checked button due to the overview
showing and hiding, block the normal checked callback and immediately
switch to the workspaces page, so that windows seamlessly fade in.

https://bugzilla.gnome.org/show_bug.cgi?id=693974
This commit is contained in:
Cosimo Cecchi 2013-02-16 12:55:59 -05:00
parent 5f3b04ecbd
commit d8b7ac9044

View File

@ -57,6 +57,7 @@ const ViewSelector = new Lang.Class({
_init : function(searchEntry, showAppsButton) { _init : function(searchEntry, showAppsButton) {
this.actor = new Shell.Stack({ name: 'viewSelector' }); this.actor = new Shell.Stack({ name: 'viewSelector' });
this._showAppsBlocked = false;
this._showAppsButton = showAppsButton; this._showAppsButton = showAppsButton;
this._showAppsButton.connect('notify::checked', Lang.bind(this, this._onShowAppsButtonToggled)); this._showAppsButton.connect('notify::checked', Lang.bind(this, this._onShowAppsButtonToggled));
@ -247,12 +248,19 @@ const ViewSelector = new Lang.Class({
}, },
_onShowAppsButtonToggled: function() { _onShowAppsButtonToggled: function() {
this._showPage(this._showAppsButton.checked ? this._appsPage if (this._showAppsBlocked)
: this._workspacesPage); return;
this._showPage(this._showAppsButton.checked ?
this._appsPage : this._workspacesPage);
}, },
_resetShowAppsButton: function() { _resetShowAppsButton: function() {
this._showAppsBlocked = true;
this._showAppsButton.checked = false; this._showAppsButton.checked = false;
this._showAppsBlocked = false;
this._showPage(this._workspacesPage, true);
}, },
_onStageKeyPress: function(actor, event) { _onStageKeyPress: function(actor, event) {