mirror of
https://github.com/edu4rdshl/gnome-shell.git
synced 2026-07-18 07:34:54 +00:00
ScreenShield: show the unlock dialog on the primary monitor when using the keyboard
Make ModalDialog.open() accept an optional onPrimary argument, and pass it when the dialog is activated using ESC or Return. https://bugzilla.gnome.org/show_bug.cgi?id=685855
This commit is contained in:
parent
f94369dd6e
commit
48fb16b570
3 changed files with 17 additions and 10 deletions
|
|
@ -202,8 +202,11 @@ const ModalDialog = new Lang.Class({
|
|||
this.emit('destroy');
|
||||
},
|
||||
|
||||
_fadeOpen: function() {
|
||||
this._monitorConstraint.index = global.screen.get_current_monitor();
|
||||
_fadeOpen: function(onPrimary) {
|
||||
if (onPrimary)
|
||||
this._monitorConstraint.primary = true;
|
||||
else
|
||||
this._monitorConstraint.index = global.screen.get_current_monitor();
|
||||
|
||||
this.state = State.OPENING;
|
||||
|
||||
|
|
@ -236,14 +239,14 @@ const ModalDialog = new Lang.Class({
|
|||
}));
|
||||
},
|
||||
|
||||
open: function(timestamp) {
|
||||
open: function(timestamp, onPrimary) {
|
||||
if (this.state == State.OPENED || this.state == State.OPENING)
|
||||
return true;
|
||||
|
||||
if (!this.pushModal(timestamp))
|
||||
return false;
|
||||
|
||||
this._fadeOpen();
|
||||
this._fadeOpen(onPrimary);
|
||||
return true;
|
||||
},
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue