[gnome-shell] Remove LayoutManager::fullscreen-changed
- From: Owen Taylor <otaylor src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] Remove LayoutManager::fullscreen-changed
- Date: Mon, 29 Apr 2013 15:22:07 +0000 (UTC)
commit 9ae2440ec14067c5b6c30dc89af676d65b92683d
Author: Owen W. Taylor <otaylor fishsoup net>
Date: Mon Mar 18 15:02:05 2013 -0400
Remove LayoutManager::fullscreen-changed
Since we now have global.screen::in-fullscreen-changed, remove the
duplicate signal. To prevent ordering problems in connecting to
this signal, make inFullscreen a property-function of a new Monitor
object rather than a data property we tack on to a Rectangle object.
https://bugzilla.gnome.org/show_bug.cgi?id=649748
js/ui/layout.js | 23 +++++++++++++++++------
js/ui/messageTray.js | 3 +--
2 files changed, 18 insertions(+), 8 deletions(-)
---
diff --git a/js/ui/layout.js b/js/ui/layout.js
index d4dc293..67c277c 100644
--- a/js/ui/layout.js
+++ b/js/ui/layout.js
@@ -118,6 +118,22 @@ const MonitorConstraint = new Lang.Class({
}
});
+const Monitor = new Lang.Class({
+ Name: 'Monitor',
+
+ _init: function(index, geometry) {
+ this.index = index;
+ this.x = geometry.x;
+ this.y = geometry.y;
+ this.width = geometry.width;
+ this.height = geometry.height;
+ },
+
+ get inFullscreen() {
+ return global.screen.get_monitor_in_fullscreen(this.index);
+ }
+})
+
const defaultParams = {
trackFullscreen: false,
affectsStruts: false,
@@ -261,7 +277,7 @@ const LayoutManager = new Lang.Class({
this.monitors = [];
let nMonitors = screen.get_n_monitors();
for (let i = 0; i < nMonitors; i++)
- this.monitors.push(screen.get_monitor_geometry(i));
+ this.monitors.push(new Monitor(i, screen.get_monitor_geometry(i)));
if (nMonitors == 1) {
this.primaryIndex = this.bottomIndex = 0;
@@ -904,13 +920,8 @@ const LayoutManager = new Lang.Class({
},
_updateFullscreen: function() {
- for (let i = 0; i < this.monitors.length; i++)
- this.monitors[i].inFullscreen = global.screen.get_monitor_in_fullscreen (i);
-
this._updateVisibility();
this._queueUpdateRegions();
-
- this.emit('fullscreen-changed');
},
_windowsRestacked: function() {
diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js
index c9e64e7..c1c3a83 100644
--- a/js/ui/messageTray.js
+++ b/js/ui/messageTray.js
@@ -1657,7 +1657,6 @@ const MessageTray = new Lang.Class({
this._desktopCloneState = State.HIDDEN;
this._notificationRemoved = false;
this._reNotifyAfterHideNotification = null;
- this._inFullscreen = false;
this._desktopClone = null;
this._inCtrlAltTab = false;
@@ -1674,7 +1673,7 @@ const MessageTray = new Lang.Class({
Main.layoutManager.trackChrome(this._notificationWidget);
Main.layoutManager.trackChrome(this._closeButton);
- Main.layoutManager.connect('fullscreen-changed', Lang.bind(this, this._updateState));
+ global.screen.connect('in-fullscreen-changed', Lang.bind(this, this._updateState));
Main.layoutManager.connect('hot-corners-changed', Lang.bind(this, this._hotCornersChanged));
// If the overview shows or hides while we're in
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]