[gnome-shell-extensions] apps-menu: don't store the hot corner at creation
- From: Giovanni Campagna <gcampagna src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell-extensions] apps-menu: don't store the hot corner at creation
- Date: Thu, 4 Jul 2013 14:06:34 +0000 (UTC)
commit a2f14c57c5855a6214aeb66be159ed2a986783f9
Author: Giovanni Campagna <gcampagna src gnome org>
Date: Thu Jul 4 15:45:04 2013 +0200
apps-menu: don't store the hot corner at creation
HotCorners become invalid when the xrandr configuration changes,
so instead of storing it fetch it directly from layoutManager when
needed.
https://bugzilla.gnome.org/show_bug.cgi?id=702038
extensions/apps-menu/extension.js | 22 ++++++++++++----------
1 files changed, 12 insertions(+), 10 deletions(-)
---
diff --git a/extensions/apps-menu/extension.js b/extensions/apps-menu/extension.js
index 8e6a4a2..a822d44 100644
--- a/extensions/apps-menu/extension.js
+++ b/extensions/apps-menu/extension.js
@@ -227,24 +227,23 @@ const ApplicationsMenu = new Lang.Class({
Name: 'ApplicationsMenu',
Extends: PopupMenu.PopupMenu,
- _init: function(sourceActor, arrowAlignment, arrowSide, button, hotCorner) {
+ _init: function(sourceActor, arrowAlignment, arrowSide, button) {
this.parent(sourceActor, arrowAlignment, arrowSide);
this._button = button;
- this._hotCorner = hotCorner;
},
open: function(animate) {
- this._hotCorner.setBarrierSize(0);
- if (this._hotCorner.actor) // fallback corner
- this._hotCorner.actor.hide();
+ this._button.hotCorner.setBarrierSize(0);
+ if (this._button.hotCorner.actor) // fallback corner
+ this._button.hotCorner.actor.hide();
this.parent(animate);
},
close: function(animate) {
let size = Main.layoutManager.panelBox.height;
- this._hotCorner.setBarrierSize(size);
- if (this._hotCorner.actor) // fallback corner
- this._hotCorner.actor.show();
+ this._button.hotCorner.setBarrierSize(size);
+ if (this._button.hotCorner.actor) // fallback corner
+ this._button.hotCorner.actor.show();
this.parent(animate);
},
@@ -265,9 +264,8 @@ const ApplicationsButton = new Lang.Class({
_init: function() {
this.parent(1.0, null, false);
- this._hotCorner = Main.layoutManager.hotCorners[Main.layoutManager.primaryIndex];
- this.setMenu(new ApplicationsMenu(this.actor, 1.0, St.Side.TOP, this, this._hotCorner));
+ this.setMenu(new ApplicationsMenu(this.actor, 1.0, St.Side.TOP, this));
Main.panel.menuManager.addMenu(this.menu);
// At this moment applications menu is not keyboard navigable at
@@ -310,6 +308,10 @@ const ApplicationsButton = new Lang.Class({
}));
},
+ get hotCorner() {
+ return Main.layoutManager.hotCorners[Main.layoutManager.primaryIndex];
+ },
+
_createVertSeparator: function() {
let separator = new St.DrawingArea({ style_class: 'calendar-vertical-separator',
pseudo_class: 'highlighted' });
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]