From dad80b3d200de0b793609d6f1bece8bf1c46a6c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Sun, 6 Jun 2010 00:35:26 +0200 Subject: [PATCH] [appWellIcon] Set correct style in constructor Currently, only the base style class is set in the constructor, the style update according to the state of the represented app is deferred until the actor is shown. As existing icons are destroyed and recreated when the number of icons changes, this behavior causes the icons of running apps to flicker if CSS transitions are used. Set the style directly in the constructor and update the code to not delay style updates until the actor is shown - StWidget does defer expensive calculations until the actor is mapped anyway. https://bugzilla.gnome.org/show_bug.cgi?id=620782 --- js/ui/appDisplay.js | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js index 71243c3f9..edf54c735 100644 --- a/js/ui/appDisplay.js +++ b/js/ui/appDisplay.js @@ -470,24 +470,19 @@ AppWellIcon.prototype = { })); this.actor.connect('button-press-event', Lang.bind(this, this._onButtonPress)); - this.actor.connect('show', Lang.bind(this, this._onShow)); - this.actor.connect('hide', Lang.bind(this, this._onHideDestroy)); - this.actor.connect('destroy', Lang.bind(this, this._onHideDestroy)); + this.actor.connect('destroy', Lang.bind(this, this._onDestroy)); - this._stateChangedId = 0; this._menuTimeoutId = 0; - }, - - _onShow: function() { this._stateChangedId = this.app.connect('notify::state', Lang.bind(this, this._onStateChanged)); this._onStateChanged(); }, - _onHideDestroy: function() { + _onDestroy: function() { if (this._stateChangedId > 0) this.app.disconnect(this._stateChangedId); + this._stateChangedId = 0; this._removeMenuTimeout(); },