messageTray: use a "hot corner" to summon the tray
Instead of leaving the tray covering the whole last pixel row when it's hidden, hide it completely. This avoids mouse events not being delivered to application windows on the last pixel row. To summon the tray we use a single reactive pixel on the corner. https://bugzilla.gnome.org/show_bug.cgi?id=663366
This commit is contained in:
parent
ab6a7773ce
commit
0cbaeaefed
@ -1430,8 +1430,16 @@ const MessageTray = new Lang.Class({
|
|||||||
this._notificationRemoved = false;
|
this._notificationRemoved = false;
|
||||||
this._reNotifyAfterHideNotification = null;
|
this._reNotifyAfterHideNotification = null;
|
||||||
|
|
||||||
|
this._corner = new Clutter.Rectangle({ width: 1,
|
||||||
|
height: 1,
|
||||||
|
opacity: 0,
|
||||||
|
reactive: true });
|
||||||
|
this._corner.connect('enter-event', Lang.bind(this, this._onCornerEnter));
|
||||||
|
Main.layoutManager.trayBox.add_actor(this._corner);
|
||||||
|
Main.layoutManager.trackChrome(this._corner);
|
||||||
|
|
||||||
Main.layoutManager.trayBox.add_actor(this.actor);
|
Main.layoutManager.trayBox.add_actor(this.actor);
|
||||||
this.actor.y = -1;
|
this.actor.y = this.actor.height;
|
||||||
Main.layoutManager.trackChrome(this.actor);
|
Main.layoutManager.trackChrome(this.actor);
|
||||||
Main.layoutManager.trackChrome(this._notificationBin);
|
Main.layoutManager.trackChrome(this._notificationBin);
|
||||||
|
|
||||||
@ -1470,12 +1478,24 @@ const MessageTray = new Lang.Class({
|
|||||||
this._chatSummaryItemsCount = 0;
|
this._chatSummaryItemsCount = 0;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
_onCornerEnter: function(actor, event) {
|
||||||
|
this._pointerInSummary = true;
|
||||||
|
this._updateState();
|
||||||
|
},
|
||||||
|
|
||||||
_setSizePosition: function() {
|
_setSizePosition: function() {
|
||||||
let monitor = Main.layoutManager.bottomMonitor;
|
let monitor = Main.layoutManager.bottomMonitor;
|
||||||
this._notificationBin.x = 0;
|
this._notificationBin.x = 0;
|
||||||
this._notificationBin.width = monitor.width;
|
this._notificationBin.width = monitor.width;
|
||||||
this._summaryBin.x = 0;
|
this._summaryBin.x = 0;
|
||||||
this._summaryBin.width = monitor.width;
|
this._summaryBin.width = monitor.width;
|
||||||
|
|
||||||
|
if (St.Widget.get_default_direction() == St.TextDirection.RTL)
|
||||||
|
this._corner.x = 0;
|
||||||
|
else
|
||||||
|
this._corner.x = Main.layoutManager.trayBox.width - 1;
|
||||||
|
|
||||||
|
this._corner.y = Main.layoutManager.trayBox.height - 1;
|
||||||
},
|
},
|
||||||
|
|
||||||
contains: function(source) {
|
contains: function(source) {
|
||||||
@ -2076,7 +2096,7 @@ const MessageTray = new Lang.Class({
|
|||||||
|
|
||||||
_hideTray: function() {
|
_hideTray: function() {
|
||||||
this._tween(this.actor, '_trayState', State.HIDDEN,
|
this._tween(this.actor, '_trayState', State.HIDDEN,
|
||||||
{ y: -1,
|
{ y: this.actor.height,
|
||||||
time: ANIMATION_TIME,
|
time: ANIMATION_TIME,
|
||||||
transition: 'easeOutQuad'
|
transition: 'easeOutQuad'
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user