|
|
e1cefa |
From 3ca39599e941563898b920a04192be0edb372470 Mon Sep 17 00:00:00 2001
|
|
|
e1cefa |
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
|
|
|
e1cefa |
Date: Mon, 23 Mar 2015 23:48:56 +0100
|
|
|
e1cefa |
Subject: [PATCH 1/3] apps-menu: Clean up signal code
|
|
|
e1cefa |
|
|
|
e1cefa |
Setting up signal handlers inside a class and rely on outside code
|
|
|
e1cefa |
to disconnect them via global variables is utterly weird. Just
|
|
|
e1cefa |
disconnect everything inside the class when the corresponding actor
|
|
|
e1cefa |
is destroyed.
|
|
|
e1cefa |
|
|
|
e1cefa |
https://bugzilla.gnome.org/show_bug.cgi?id=746639
|
|
|
e1cefa |
---
|
|
|
e1cefa |
extensions/apps-menu/extension.js | 24 ++++++++++++------------
|
|
|
e1cefa |
1 file changed, 12 insertions(+), 12 deletions(-)
|
|
|
e1cefa |
|
|
|
e1cefa |
diff --git a/extensions/apps-menu/extension.js b/extensions/apps-menu/extension.js
|
|
|
e1cefa |
index 2d198c1..b392a91 100644
|
|
|
e1cefa |
--- a/extensions/apps-menu/extension.js
|
|
|
e1cefa |
+++ b/extensions/apps-menu/extension.js
|
|
|
e1cefa |
@@ -297,18 +297,19 @@ const ApplicationsButton = new Lang.Class({
|
|
|
e1cefa |
this.actor.label_actor = this._label;
|
|
|
e1cefa |
|
|
|
e1cefa |
this.actor.connect('captured-event', Lang.bind(this, this._onCapturedEvent));
|
|
|
e1cefa |
+ this.actor.connect('destroy', Lang.bind(this, this._onDestroy));
|
|
|
e1cefa |
|
|
|
e1cefa |
- _showingId = Main.overview.connect('showing', Lang.bind(this, function() {
|
|
|
e1cefa |
+ this._showingId = Main.overview.connect('showing', Lang.bind(this, function() {
|
|
|
e1cefa |
this.actor.add_accessible_state (Atk.StateType.CHECKED);
|
|
|
e1cefa |
}));
|
|
|
e1cefa |
- _hidingId = Main.overview.connect('hiding', Lang.bind(this, function() {
|
|
|
e1cefa |
+ this._hidingId = Main.overview.connect('hiding', Lang.bind(this, function() {
|
|
|
e1cefa |
this.actor.remove_accessible_state (Atk.StateType.CHECKED);
|
|
|
e1cefa |
}));
|
|
|
e1cefa |
|
|
|
e1cefa |
this.reloadFlag = false;
|
|
|
e1cefa |
this._createLayout();
|
|
|
e1cefa |
this._display();
|
|
|
e1cefa |
- _installedChangedId = appSys.connect('installed-changed', Lang.bind(this, function() {
|
|
|
e1cefa |
+ this._installedChangedId = appSys.connect('installed-changed', Lang.bind(this, function() {
|
|
|
e1cefa |
if (this.menu.isOpen) {
|
|
|
e1cefa |
this._redisplay();
|
|
|
e1cefa |
this.mainBox.show();
|
|
|
e1cefa |
@@ -320,7 +321,7 @@ const ApplicationsButton = new Lang.Class({
|
|
|
e1cefa |
// Since the hot corner uses stage coordinates, Clutter won't
|
|
|
e1cefa |
// queue relayouts for us when the panel moves. Queue a relayout
|
|
|
e1cefa |
// when that happens.
|
|
|
e1cefa |
- _panelBoxChangedId = Main.layoutManager.connect('panel-box-changed', Lang.bind(this, function() {
|
|
|
e1cefa |
+ this._panelBoxChangedId = Main.layoutManager.connect('panel-box-changed', Lang.bind(this, function() {
|
|
|
e1cefa |
container.queue_relayout();
|
|
|
e1cefa |
}));
|
|
|
e1cefa |
},
|
|
|
e1cefa |
@@ -336,6 +337,13 @@ const ApplicationsButton = new Lang.Class({
|
|
|
e1cefa |
return separator;
|
|
|
e1cefa |
},
|
|
|
e1cefa |
|
|
|
e1cefa |
+ _onDestroy: function() {
|
|
|
e1cefa |
+ Main.overview.disconnect(this._showingId);
|
|
|
e1cefa |
+ Main.overview.disconnect(this._hidingId);
|
|
|
e1cefa |
+ Main.layoutManager.disconnect(this._panelBoxChangedId);
|
|
|
e1cefa |
+ appSys.disconnect(this._installedChangedId);
|
|
|
e1cefa |
+ },
|
|
|
e1cefa |
+
|
|
|
e1cefa |
_onCapturedEvent: function(actor, event) {
|
|
|
e1cefa |
if (event.type() == Clutter.EventType.BUTTON_PRESS) {
|
|
|
e1cefa |
if (!Main.overview.shouldToggleByCornerOrButton())
|
|
|
e1cefa |
@@ -583,10 +591,6 @@ const ApplicationsButton = new Lang.Class({
|
|
|
e1cefa |
|
|
|
e1cefa |
let appsMenuButton;
|
|
|
e1cefa |
let activitiesButton;
|
|
|
e1cefa |
-let _hidingId;
|
|
|
e1cefa |
-let _installedChangedId;
|
|
|
e1cefa |
-let _panelBoxChangedId;
|
|
|
e1cefa |
-let _showingId;
|
|
|
e1cefa |
|
|
|
e1cefa |
function enable() {
|
|
|
e1cefa |
activitiesButton = Main.panel.statusArea['activities'];
|
|
|
e1cefa |
@@ -604,10 +608,6 @@ function enable() {
|
|
|
e1cefa |
|
|
|
e1cefa |
function disable() {
|
|
|
e1cefa |
Main.panel.menuManager.removeMenu(appsMenuButton.menu);
|
|
|
e1cefa |
- appSys.disconnect(_installedChangedId);
|
|
|
e1cefa |
- Main.layoutManager.disconnect(_panelBoxChangedId);
|
|
|
e1cefa |
- Main.overview.disconnect(_hidingId);
|
|
|
e1cefa |
- Main.overview.disconnect(_showingId);
|
|
|
e1cefa |
appsMenuButton.destroy();
|
|
|
e1cefa |
activitiesButton.container.show();
|
|
|
e1cefa |
|
|
|
e1cefa |
--
|
|
|
e1cefa |
2.5.0
|
|
|
e1cefa |
|
|
|
e1cefa |
|
|
|
e1cefa |
From ddd92a1cdd2b9ab8e2ba054c8a2a131ae277808d Mon Sep 17 00:00:00 2001
|
|
|
e1cefa |
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
|
|
|
e1cefa |
Date: Mon, 23 Mar 2015 23:55:43 +0100
|
|
|
e1cefa |
Subject: [PATCH 2/3] apps-menu: Move panel-main-menu handling into
|
|
|
e1cefa |
AppsMenuButton
|
|
|
e1cefa |
|
|
|
e1cefa |
This is really where it belongs, and will make an upcoming fix slightly
|
|
|
e1cefa |
less ugly ...
|
|
|
e1cefa |
|
|
|
e1cefa |
https://bugzilla.gnome.org/show_bug.cgi?id=746639
|
|
|
e1cefa |
---
|
|
|
e1cefa |
extensions/apps-menu/extension.js | 31 +++++++++++++++++--------------
|
|
|
e1cefa |
1 file changed, 17 insertions(+), 14 deletions(-)
|
|
|
e1cefa |
|
|
|
e1cefa |
diff --git a/extensions/apps-menu/extension.js b/extensions/apps-menu/extension.js
|
|
|
e1cefa |
index b392a91..03a50b7 100644
|
|
|
e1cefa |
--- a/extensions/apps-menu/extension.js
|
|
|
e1cefa |
+++ b/extensions/apps-menu/extension.js
|
|
|
e1cefa |
@@ -305,6 +305,7 @@ const ApplicationsButton = new Lang.Class({
|
|
|
e1cefa |
this._hidingId = Main.overview.connect('hiding', Lang.bind(this, function() {
|
|
|
e1cefa |
this.actor.remove_accessible_state (Atk.StateType.CHECKED);
|
|
|
e1cefa |
}));
|
|
|
e1cefa |
+ this._setKeybinding();
|
|
|
e1cefa |
|
|
|
e1cefa |
this.reloadFlag = false;
|
|
|
e1cefa |
this._createLayout();
|
|
|
e1cefa |
@@ -342,6 +343,13 @@ const ApplicationsButton = new Lang.Class({
|
|
|
e1cefa |
Main.overview.disconnect(this._hidingId);
|
|
|
e1cefa |
Main.layoutManager.disconnect(this._panelBoxChangedId);
|
|
|
e1cefa |
appSys.disconnect(this._installedChangedId);
|
|
|
e1cefa |
+
|
|
|
e1cefa |
+ Main.wm.setCustomKeybindingHandler('panel-main-menu',
|
|
|
e1cefa |
+ Shell.KeyBindingMode.NORMAL |
|
|
|
e1cefa |
+ Shell.KeyBindingMode.OVERVIEW,
|
|
|
e1cefa |
+ Main.sessionMode.hasOverview ?
|
|
|
e1cefa |
+ Lang.bind(Main.overview, Main.overview.toggle) :
|
|
|
e1cefa |
+ null);
|
|
|
e1cefa |
},
|
|
|
e1cefa |
|
|
|
e1cefa |
_onCapturedEvent: function(actor, event) {
|
|
|
e1cefa |
@@ -389,6 +397,15 @@ const ApplicationsButton = new Lang.Class({
|
|
|
e1cefa |
this.parent(menu, open);
|
|
|
e1cefa |
},
|
|
|
e1cefa |
|
|
|
e1cefa |
+ _setKeybinding: function() {
|
|
|
e1cefa |
+ Main.wm.setCustomKeybindingHandler('panel-main-menu',
|
|
|
e1cefa |
+ Shell.KeyBindingMode.NORMAL |
|
|
|
e1cefa |
+ Shell.KeyBindingMode.OVERVIEW,
|
|
|
e1cefa |
+ Lang.bind(this, function() {
|
|
|
e1cefa |
+ this.menu.toggle();
|
|
|
e1cefa |
+ }));
|
|
|
e1cefa |
+ },
|
|
|
e1cefa |
+
|
|
|
e1cefa |
_redisplay: function() {
|
|
|
e1cefa |
this.applicationsBox.destroy_all_children();
|
|
|
e1cefa |
this.categoriesBox.destroy_all_children();
|
|
|
e1cefa |
@@ -597,26 +614,12 @@ function enable() {
|
|
|
e1cefa |
activitiesButton.container.hide();
|
|
|
e1cefa |
appsMenuButton = new ApplicationsButton();
|
|
|
e1cefa |
Main.panel.addToStatusArea('apps-menu', appsMenuButton, 1, 'left');
|
|
|
e1cefa |
-
|
|
|
e1cefa |
- Main.wm.setCustomKeybindingHandler('panel-main-menu',
|
|
|
e1cefa |
- Shell.KeyBindingMode.NORMAL |
|
|
|
e1cefa |
- Shell.KeyBindingMode.OVERVIEW,
|
|
|
e1cefa |
- function() {
|
|
|
e1cefa |
- appsMenuButton.menu.toggle();
|
|
|
e1cefa |
- });
|
|
|
e1cefa |
}
|
|
|
e1cefa |
|
|
|
e1cefa |
function disable() {
|
|
|
e1cefa |
Main.panel.menuManager.removeMenu(appsMenuButton.menu);
|
|
|
e1cefa |
appsMenuButton.destroy();
|
|
|
e1cefa |
activitiesButton.container.show();
|
|
|
e1cefa |
-
|
|
|
e1cefa |
- Main.wm.setCustomKeybindingHandler('panel-main-menu',
|
|
|
e1cefa |
- Shell.KeyBindingMode.NORMAL |
|
|
|
e1cefa |
- Shell.KeyBindingMode.OVERVIEW,
|
|
|
e1cefa |
- Main.sessionMode.hasOverview ?
|
|
|
e1cefa |
- Lang.bind(Main.overview, Main.overview.toggle) :
|
|
|
e1cefa |
- null);
|
|
|
e1cefa |
}
|
|
|
e1cefa |
|
|
|
e1cefa |
function init(metadata) {
|
|
|
e1cefa |
--
|
|
|
e1cefa |
2.5.0
|
|
|
e1cefa |
|
|
|
e1cefa |
|
|
|
e1cefa |
From cff31d811ece77cf6eae017c6e7223f87c67cacc Mon Sep 17 00:00:00 2001
|
|
|
e1cefa |
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
|
|
|
e1cefa |
Date: Tue, 24 Mar 2015 00:28:10 +0100
|
|
|
e1cefa |
Subject: [PATCH 3/3] apps-menu: Take over shortcuts again on startup-complete
|
|
|
e1cefa |
|
|
|
e1cefa |
For a while now, gnome-shell has initialized extensions before
|
|
|
e1cefa |
setting up its own keybinding handling. As a result, our taking
|
|
|
e1cefa |
over of the panel-main-menu shortcut will be overwritten when
|
|
|
e1cefa |
the extension is enabled at startup - work around this by setting
|
|
|
e1cefa |
up the keybinding again on LayoutManager::startup-complete.
|
|
|
e1cefa |
|
|
|
e1cefa |
https://bugzilla.gnome.org/show_bug.cgi?id=746639
|
|
|
e1cefa |
---
|
|
|
e1cefa |
extensions/apps-menu/extension.js | 2 ++
|
|
|
e1cefa |
1 file changed, 2 insertions(+)
|
|
|
e1cefa |
|
|
|
e1cefa |
diff --git a/extensions/apps-menu/extension.js b/extensions/apps-menu/extension.js
|
|
|
e1cefa |
index 03a50b7..719f298 100644
|
|
|
e1cefa |
--- a/extensions/apps-menu/extension.js
|
|
|
e1cefa |
+++ b/extensions/apps-menu/extension.js
|
|
|
e1cefa |
@@ -305,6 +305,8 @@ const ApplicationsButton = new Lang.Class({
|
|
|
e1cefa |
this._hidingId = Main.overview.connect('hiding', Lang.bind(this, function() {
|
|
|
e1cefa |
this.actor.remove_accessible_state (Atk.StateType.CHECKED);
|
|
|
e1cefa |
}));
|
|
|
e1cefa |
+ Main.layoutManager.connect('startup-complete',
|
|
|
e1cefa |
+ Lang.bind(this, this._setKeybinding));
|
|
|
e1cefa |
this._setKeybinding();
|
|
|
e1cefa |
|
|
|
e1cefa |
this.reloadFlag = false;
|
|
|
e1cefa |
--
|
|
|
e1cefa |
2.5.0
|
|
|
e1cefa |
|