messageTray: Always close the tray when clicking outside of it
Even when a summary box pointer item is up.
This commit is contained in:
parent
3568e6d42d
commit
4dfe3d21e1
@ -84,7 +84,14 @@ const GrabHelper = new Lang.Class({
|
|||||||
},
|
},
|
||||||
|
|
||||||
get currentGrab() {
|
get currentGrab() {
|
||||||
return this._grabStack[this._grabStack.length - 1] || {};
|
if (!this._grabStack.length)
|
||||||
|
return {};
|
||||||
|
|
||||||
|
let idx = this._grabStack.length - 1;
|
||||||
|
while (idx >= 0 && this._grabStack[idx].untracked)
|
||||||
|
idx--;
|
||||||
|
|
||||||
|
return this._grabStack[idx];
|
||||||
},
|
},
|
||||||
|
|
||||||
_findStackIndex: function(actor) {
|
_findStackIndex: function(actor) {
|
||||||
@ -132,10 +139,13 @@ const GrabHelper = new Lang.Class({
|
|||||||
// revert it back, and re-focus the previously-focused window (if
|
// revert it back, and re-focus the previously-focused window (if
|
||||||
// another window hasn't been explicitly focused before then).
|
// another window hasn't been explicitly focused before then).
|
||||||
//
|
//
|
||||||
//
|
// If @params contains { untracked: true }, then it will be skipped
|
||||||
|
// when the grab helper ungrabs for you, or when calculating
|
||||||
|
// currentGrab.
|
||||||
grab: function(params) {
|
grab: function(params) {
|
||||||
params = Params.parse(params, { actor: null,
|
params = Params.parse(params, { actor: null,
|
||||||
modal: false,
|
modal: false,
|
||||||
|
untracked: false,
|
||||||
grabFocus: false,
|
grabFocus: false,
|
||||||
onUngrab: null });
|
onUngrab: null });
|
||||||
|
|
||||||
|
@ -2213,6 +2213,7 @@ const MessageTray = new Lang.Class({
|
|||||||
}
|
}
|
||||||
|
|
||||||
this._grabHelper.grab({ actor: this._summaryBoxPointer.bin.child,
|
this._grabHelper.grab({ actor: this._summaryBoxPointer.bin.child,
|
||||||
|
untracked: true,
|
||||||
grabFocus: true,
|
grabFocus: true,
|
||||||
onUngrab: Lang.bind(this, this._onSummaryBoxPointerUngrabbed) });
|
onUngrab: Lang.bind(this, this._onSummaryBoxPointerUngrabbed) });
|
||||||
this._lock();
|
this._lock();
|
||||||
|
Loading…
Reference in New Issue
Block a user