[gnome-shell/wip/menus-rebase2] Application Menu: watch for menu property changes
- From: Giovanni Campagna <gcampagna src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/wip/menus-rebase2] Application Menu: watch for menu property changes
- Date: Thu, 8 Dec 2011 21:16:20 +0000 (UTC)
commit 95e5c5cfb13ac3c1e0744936f6ccfc3edc0122ae
Author: Giovanni Campagna <gcampagna src gnome org>
Date: Thu Dec 8 21:55:51 2011 +0100
Application Menu: watch for menu property changes
By the time the window is first mapped and the app menu button is
synced, we may not have finished reading the menu. In that case,
connect to notify::menu and update accordingly.
js/ui/panel.js | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/js/ui/panel.js b/js/ui/panel.js
index 78a14a1..3f3f74b 100644
--- a/js/ui/panel.js
+++ b/js/ui/panel.js
@@ -243,6 +243,7 @@ const AppMenuButton = new Lang.Class({
this._menuManager = menuManager;
this._targetApp = null;
+ this._appMenuNotifyId = 0;
let bin = new St.Bin({ name: 'appMenu' });
this.actor.add_actor(bin);
@@ -519,6 +520,11 @@ const AppMenuButton = new Lang.Class({
this._iconBox.hide();
this._label.setText('');
+ if (this._appMenuNotifyId)
+ this._targetApp.disconnect(this._appMenuNotifyId);
+ if (targetApp)
+ this._appMenuNotifyId = targetApp.connect('notify::menu', Lang.bind(this, this._sync));
+
this._targetApp = targetApp;
let icon = targetApp.get_faded_icon(2 * PANEL_ICON_SIZE);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]