r35997 - in /desktop/experimental/gnome-shell/debian: changelog patches/30-remoteMenu-Prevent-the-shell-from-becoming-unrespons.patch patches/series
sjoerd at users.alioth.debian.org
sjoerd at users.alioth.debian.org
Fri Oct 19 23:38:20 UTC 2012
Author: sjoerd
Date: Fri Oct 19 23:38:20 2012
New Revision: 35997
URL: http://svn.debian.org/wsvn/pkg-gnome/?sc=1&rev=35997
Log:
* d/p/30-remoteMenu-Prevent-the-shell-from-becoming-unrespons.patch:
- Added, prevent gnome-shell from become unresponsive (bgo: #686502)
Added:
desktop/experimental/gnome-shell/debian/patches/30-remoteMenu-Prevent-the-shell-from-becoming-unrespons.patch
Modified:
desktop/experimental/gnome-shell/debian/changelog
desktop/experimental/gnome-shell/debian/patches/series
Modified: desktop/experimental/gnome-shell/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/experimental/gnome-shell/debian/changelog?rev=35997&op=diff
==============================================================================
--- desktop/experimental/gnome-shell/debian/changelog [utf-8] (original)
+++ desktop/experimental/gnome-shell/debian/changelog [utf-8] Fri Oct 19 23:38:20 2012
@@ -1,3 +1,10 @@
+gnome-shell (3.6.1-2) experimental; urgency=low
+
+ * d/p/30-remoteMenu-Prevent-the-shell-from-becoming-unrespons.patch:
+ - Added, prevent gnome-shell from become unresponsive (bgo: #686502)
+
+ -- Sjoerd Simons <sjoerd at debian.org> Sat, 20 Oct 2012 01:17:07 +0200
+
gnome-shell (3.6.1-1) experimental; urgency=low
* New upstream release
Added: desktop/experimental/gnome-shell/debian/patches/30-remoteMenu-Prevent-the-shell-from-becoming-unrespons.patch
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/experimental/gnome-shell/debian/patches/30-remoteMenu-Prevent-the-shell-from-becoming-unrespons.patch?rev=35997&op=file
==============================================================================
--- desktop/experimental/gnome-shell/debian/patches/30-remoteMenu-Prevent-the-shell-from-becoming-unrespons.patch (added)
+++ desktop/experimental/gnome-shell/debian/patches/30-remoteMenu-Prevent-the-shell-from-becoming-unrespons.patch [utf-8] Fri Oct 19 23:38:20 2012
@@ -1,0 +1,134 @@
+From 7b206429d7b4929524062078e9ef71c7beee85df Mon Sep 17 00:00:00 2001
+From: Sjoerd Simons <sjoerd at luon.net>
+Date: Fri, 19 Oct 2012 23:56:08 +0200
+Subject: [PATCH] remoteMenu: Prevent the shell from becoming unresponsive
+
+I noticed that in some cases gnome-shell started using 100% just after
+startup, which seemingly coincided with the Empathy roster application.
+After some more research this turned out to be triggered by the remote
+menu.
+
+Every time the _modelChanged function runs through the model it will
+connect to action-added for every item which is in the model but not in
+the action group. The callback for the action-added signal forces a
+refresh of the whole model, which means all items that haven't been
+added yet will now have one more signal handler connected.
+
+In my case Empathy has a quite a few items in its menu (caused by the
+amount of favourite rooms is have), which meant that the amount of
+signal handlers spirals out of control causing gnome-shell to become
+unresponsive for long periods of time.
+
+Solve this by always listening for the relevant signals which sidesteps
+the whole issue.
+---
+ js/ui/popupMenu.js | 37 ++++++++++++++++++++++---------------
+ 1 file changed, 22 insertions(+), 15 deletions(-)
+
+diff --git a/js/ui/popupMenu.js b/js/ui/popupMenu.js
+index 23368a5..984d077 100644
+--- a/js/ui/popupMenu.js
++++ b/js/ui/popupMenu.js
+@@ -1800,6 +1800,7 @@ const RemoteMenu = new Lang.Class({
+ this._actions = { };
+ this._modelChanged(this.model, 0, 0, this.model.get_n_items(), this);
+
++ this._actionAddedId = this.actionGroup.connect('action-added', Lang.bind(this, this._actionAdded));
+ this._actionStateChangeId = this.actionGroup.connect('action-state-changed', Lang.bind(this, this._actionStateChanged));
+ this._actionEnableChangeId = this.actionGroup.connect('action-enabled-changed', Lang.bind(this, this._actionEnabledChanged));
+ },
+@@ -1815,6 +1816,11 @@ const RemoteMenu = new Lang.Class({
+ this._actionEnableChangeId = 0;
+ }
+
++ if (this._actionAddedId) {
++ this.actionGroup.disconnect(this._actionAddedId);
++ this._actionAddedId = 0;
++ }
++
+ this.parent();
+ },
+
+@@ -1835,7 +1841,7 @@ const RemoteMenu = new Lang.Class({
+ item.addMenuItem(title);
+ }
+ this._modelChanged(section_link, 0, 0, section_link.get_n_items(), item);
+- return [item, true, ''];
++ return [item, true ];
+ }
+
+ let submenu_link = model.get_item_link(index, Gio.MENU_LINK_SUBMENU);
+@@ -1843,13 +1849,13 @@ const RemoteMenu = new Lang.Class({
+ if (submenu_link) {
+ let item = new PopupSubMenuMenuItem(label);
+ this._modelChanged(submenu_link, 0, 0, submenu_link.get_n_items(), item.menu);
+- return [item, false, ''];
++ return [item, false ];
+ }
+
+ let action_id = model.get_item_attribute_value(index, Gio.MENU_ATTRIBUTE_ACTION, null).deep_unpack();
+ if (!this.actionGroup.has_action(action_id)) {
+ // the action may not be there yet, wait for action-added
+- return [null, false, 'action-added'];
++ return [null, false ];
+ }
+
+ if (!this._actions[action_id])
+@@ -1886,7 +1892,7 @@ const RemoteMenu = new Lang.Class({
+ break;
+ default:
+ log('Action "%s" has state of type %s, which is not supported'.format(action_id, action.state.get_type_string()));
+- return [null, false, 'action-state-changed'];
++ return [null, false ];
+ }
+ } else {
+ target = model.get_item_attribute_value(index, Gio.MENU_ATTRIBUTE_TARGET, null);
+@@ -1908,7 +1914,7 @@ const RemoteMenu = new Lang.Class({
+ action.items.splice(pos, 1);
+ }));
+
+- return [item, false, ''];
++ return [item, false ];
+ },
+
+ _modelChanged: function(model, position, removed, added, target) {
+@@ -1962,14 +1968,6 @@ const RemoteMenu = new Lang.Class({
+ target.addMenuItem(separator, k+1);
+ k++;
+ }
+- } else if (changeSignal) {
+- let signalId = this.actionGroup.connect(changeSignal, Lang.bind(this, function(actionGroup, actionName) {
+- actionGroup.disconnect(signalId);
+- if (this._actions[actionName]) return;
+-
+- // force a full update
+- this._modelChanged(model, 0, -1, model.get_n_items(), target);
+- }));
+ }
+ }
+
+@@ -1997,10 +1995,19 @@ const RemoteMenu = new Lang.Class({
+ }
+ },
+
++ _actionAdded: function(actionGroup, actionName) {
++ if (this._actions[actionName]) return;
++ // new action, force a full update
++ this._modelChanged(this.model, 0, -1, this.model.get_n_items(), this);
++ },
++
+ _actionStateChanged: function(actionGroup, action_id) {
+ let action = this._actions[action_id];
+- if (!action)
+- return;
++ if (!action) {
++ // action was in an unknown state before, force a full update
++ this._modelChanged(this.model, 0, -1, this.model.get_n_items(), this);
++ return;
++ }
+
+ action.state = actionGroup.get_action_state(action_id);
+ if (action.items.length) {
+--
+1.7.10.4
+
Modified: desktop/experimental/gnome-shell/debian/patches/series
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/experimental/gnome-shell/debian/patches/series?rev=35997&op=diff
==============================================================================
--- desktop/experimental/gnome-shell/debian/patches/series [utf-8] (original)
+++ desktop/experimental/gnome-shell/debian/patches/series [utf-8] Fri Oct 19 23:38:20 2012
@@ -3,3 +3,4 @@
14_make-GLX-optional.patch
27-nm-libexec-path.patch
29-Cope-with-clutter-being-built-with-both-new-and-old-.patch
+30-remoteMenu-Prevent-the-shell-from-becoming-unrespons.patch
More information about the pkg-gnome-commits
mailing list