[gnome-shell/wip/message-tray: 1/32] messageTray: Clone, clip & move the window_group when tray is toggled
- From: Marina Zhurakhinskaya <marinaz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/wip/message-tray: 1/32] messageTray: Clone, clip & move the window_group when tray is toggled
- Date: Fri, 17 Aug 2012 01:37:01 +0000 (UTC)
commit 8af12bed52fdce009cf666d1407ea967445e81d5
Author: Debarshi Ray <debarshir gnome org>
Date: Wed Aug 8 22:48:17 2012 +0200
messageTray: Clone, clip & move the window_group when tray is toggled
1) straddling windows get clipped at the monitor boundary
2) we move the bottom monitor and not the primary because that is
where the tray is
3) to stop the wallpaper from the bottom monitor leaking into the
primary, we adjust the clip as the clone animates up/down
https://bugzilla.gnome.org/show_bug.cgi?id=681392
js/ui/messageTray.js | 51 ++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 51 insertions(+), 0 deletions(-)
---
diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js
index 2a736b6..d2184d6 100644
--- a/js/ui/messageTray.js
+++ b/js/ui/messageTray.js
@@ -1563,6 +1563,7 @@ const MessageTray = new Lang.Class({
this._notificationRemoved = false;
this._reNotifyAfterHideNotification = null;
this._inFullscreen = false;
+ this._desktopClone = null;
this._corner = new Clutter.Rectangle({ width: 1,
height: 1,
@@ -2277,6 +2278,35 @@ const MessageTray = new Lang.Class({
time: ANIMATION_TIME,
transition: 'easeOutQuad'
});
+
+ // Don't move the windows up if we are in the overview.
+ if (this._overviewVisible)
+ return;
+
+ let bottomMonitor = Main.layoutManager.bottomMonitor;
+ let geometry = new Clutter.Geometry({ x: bottomMonitor.x,
+ y: bottomMonitor.y,
+ width: bottomMonitor.width,
+ height: bottomMonitor.height
+ });
+ this._desktopClone = new Clutter.Clone({ source: global.window_group, clip: geometry });
+ Main.uiGroup.insert_child_above(this._desktopClone, global.window_group);
+ this._desktopClone.x = 0;
+ this._desktopClone.y = 0;
+ this._desktopClone.show();
+
+ Tweener.addTween(this._desktopClone,
+ { y: this._desktopClone.y - this.actor.height,
+ time: ANIMATION_TIME,
+ transition: 'easeOutQuad',
+ onUpdate: Lang.bind(this, function() {
+ let progress = -1 * this._desktopClone.y; // y is negative
+ this._desktopClone.set_clip(geometry.x,
+ geometry.y + progress,
+ geometry.width,
+ geometry.height - progress);
+ })
+ });
},
_hideTray: function() {
@@ -2285,6 +2315,27 @@ const MessageTray = new Lang.Class({
time: ANIMATION_TIME,
transition: 'easeOutQuad'
});
+
+ if (!this._desktopClone)
+ return;
+
+ let geometry = this._desktopClone.clip;
+ Tweener.addTween(this._desktopClone,
+ { y: this._desktopClone.y + this.actor.height,
+ time: ANIMATION_TIME,
+ transition: 'easeOutQuad',
+ onComplete: Lang.bind(this, function() {
+ this._desktopClone.destroy();
+ this._desktopClone = null;
+ }),
+ onUpdate: Lang.bind(this, function() {
+ let progress = this.actor.height + this._desktopClone.y; // y is negative
+ this._desktopClone.set_clip(geometry.x,
+ geometry.y - progress,
+ geometry.width,
+ geometry.height + progress);
+ })
+ });
},
_onIdleMonitorWatch: function(monitor, id, userBecameIdle) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]