layout: Construct the primary monitors's hot corner, too

This cleans up the code considerably, and makes it so that
one path creates all hot corners for all monitors. Why this
wasn't done originally, I have no clue...

The one complication is debouncing if the button and hot corner
are triggered in rapid succession, so we just move this tracking
to the overview.

https://bugzilla.gnome.org/show_bug.cgi?id=663661
This commit is contained in:
Jasper St. Pierre
2013-03-01 16:00:37 -05:00
parent 194574bb0e
commit 5679e6b3a9
5 changed files with 68 additions and 133 deletions

View File

@ -1672,14 +1672,13 @@ const MessageTray = new Lang.Class({
Main.layoutManager.trackChrome(this._closeButton);
Main.layoutManager.connect('primary-fullscreen-changed', Lang.bind(this, this._onFullscreenChanged));
Main.layoutManager.connect('hot-corners-changed', Lang.bind(this, this._hotCornersChanged));
// If the overview shows or hides while we're in
// the message tray, revert back to normal mode.
Main.overview.connect('showing', Lang.bind(this, this._escapeTray));
Main.overview.connect('hiding', Lang.bind(this, this._escapeTray));
// Track if we've added the activities button
this._activitiesButtonAdded = false;
Main.sessionMode.connect('updated', Lang.bind(this, this._sessionUpdated));
Main.wm.addKeybinding('toggle-message-tray',
@ -1703,6 +1702,7 @@ const MessageTray = new Lang.Class({
this._trayDwellTimeoutId = 0;
this._setupTrayDwellIfNeeded();
this._sessionUpdated();
this._hotCornersChanged();
this._noMessages = new St.Label({ text: _("No Messages"),
style_class: 'no-messages-label',
@ -1775,11 +1775,6 @@ const MessageTray = new Lang.Class({
},
_sessionUpdated: function() {
if (!this._activitiesButtonAdded && Main.panel.statusArea.activities) {
this._activitiesButtonAdded = true;
this._grabHelper.addActor(Main.panel.statusArea.activities.hotCorner.actor);
}
if ((Main.sessionMode.isLocked || Main.sessionMode.isGreeter) && this._inCtrlAltTab) {
Main.ctrlAltTabManager.removeGroup(this._summary);
this._inCtrlAltTab = false;
@ -2101,6 +2096,13 @@ const MessageTray = new Lang.Class({
this._updateState();
},
_hotCornersChanged: function() {
let primary = Main.layoutManager.primaryIndex;
let corner = Main.layoutManager.hotCorners[primary];
if (corner && corner.actor)
this._grabHelper.addActor(corner.actor);
},
_onTrayHoverChanged: function() {
if (this.actor.hover) {
// No dwell inside notifications at the bottom of the screen