loginDialog: handle typing at screenshield

If the screenshield is up and the user starts typing, we need to
keep track of it and replay it later, otherwise what they type
will be ignored.

This is useful when the user has disable-user-list set to TRUE,
and will also be useful to bring feature parity between the
login screen and unlock screen.

https://bugzilla.gnome.org/show_bug.cgi?id=702308
This commit is contained in:
Ray Strode 2013-07-10 10:29:17 -04:00
parent 86b8885d96
commit 6d9fb50207

View File

@ -855,6 +855,9 @@ const LoginDialog = new Lang.Class({
this._promptEntry.clutter_text.connect('activate', function() {
hold.release();
});
if (this._initialAnswer && this._initialAnswer['text'])
hold.release();
},
_updateSensitivity: function(sensitive) {
@ -903,7 +906,13 @@ const LoginDialog = new Lang.Class({
this._promptLabel.set_text(question);
this._updateSensitivity(true);
this._promptEntry.set_text('');
if (!this._initialAnswer) {
this._promptEntry.set_text('');
} else if (this._initialAnswer['activate-id']) {
this._promptEntry.clutter_text.disconnect(this._initialAnswer['activate-id']);
delete this._initialAnswer['activate-id'];
}
this._promptEntry.clutter_text.set_password_char(passwordChar);
let tasks = [function() {
@ -911,7 +920,14 @@ const LoginDialog = new Lang.Class({
},
function() {
let text = this._promptEntry.get_text();
let text;
if (this._initialAnswer && this._initialAnswer['text']) {
text = this._initialAnswer['text'];
this._initialAnswer = null;
} else {
text = this._promptEntry.get_text();
}
this._updateSensitivity(false);
this._setDefaultButtonWellMode(DefaultButtonWellMode.SPINNER, false);
this._userVerifier.answerQuery(serviceName, text);
@ -1216,7 +1232,22 @@ const LoginDialog = new Lang.Class({
},
addCharacter: function(unichar) {
if (!this._promptEntry.visible)
return;
if (!this._initialAnswer)
this._initialAnswer = {};
this._promptEntry.clutter_text.insert_unichar(unichar);
if (!this._initialAnswer['activate-id'])
this._initialAnswer['activate-id'] =
this._promptEntry.clutter_text.connect('activate', Lang.bind(this, function() {
this._promptEntry.clutter_text.disconnect(this._initialAnswer['activate-id']);
delete this._initialAnswer['activate-id'];
this._initialAnswer['text'] = this._promptEntry.get_text();
}));
},
});
Signals.addSignalMethods(LoginDialog.prototype);