unlockDialog, loginDialog: Connect to the activate signal on the entry
This is the recommended way to connect to an entry's activation binding -- event bubbling is not guaranteed by ClutterText. https://bugzilla.gnome.org/show_bug.cgi?id=695154
This commit is contained in:
parent
fbd59631ee
commit
1566a4e607
@ -594,6 +594,7 @@ const LoginDialog = new Lang.Class({
|
|||||||
this._promptEntry = new St.Entry({ style_class: 'login-dialog-prompt-entry',
|
this._promptEntry = new St.Entry({ style_class: 'login-dialog-prompt-entry',
|
||||||
can_focus: true });
|
can_focus: true });
|
||||||
this._promptEntryTextChangedId = 0;
|
this._promptEntryTextChangedId = 0;
|
||||||
|
this._promptEntryActivateId = 0;
|
||||||
this._promptBox.add(this._promptEntry,
|
this._promptBox.add(this._promptEntry,
|
||||||
{ expand: true,
|
{ expand: true,
|
||||||
x_fill: true,
|
x_fill: true,
|
||||||
@ -811,6 +812,11 @@ const LoginDialog = new Lang.Class({
|
|||||||
Lang.bind(this, function() {
|
Lang.bind(this, function() {
|
||||||
this._updateSignInButtonSensitivity(this._promptEntry.text.length > 0);
|
this._updateSignInButtonSensitivity(this._promptEntry.text.length > 0);
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
this._promptEntryActivateId =
|
||||||
|
this._promptEntry.clutter_text.connect('activate', function() {
|
||||||
|
hold.release();
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
_updateSensitivity: function(sensitive) {
|
_updateSensitivity: function(sensitive) {
|
||||||
@ -835,6 +841,11 @@ const LoginDialog = new Lang.Class({
|
|||||||
this._promptEntryTextChangedId = 0;
|
this._promptEntryTextChangedId = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this._promptEntryActivateId > 0) {
|
||||||
|
this._promptEntry.clutter_text.disconnect(this._promptEntryActivateId);
|
||||||
|
this._promptEntryActivateId = 0;
|
||||||
|
}
|
||||||
|
|
||||||
this._setWorking(false);
|
this._setWorking(false);
|
||||||
this._promptBox.hide();
|
this._promptBox.hide();
|
||||||
this._promptLoginHint.hide();
|
this._promptLoginHint.hide();
|
||||||
|
@ -98,6 +98,7 @@ const UnlockDialog = new Lang.Class({
|
|||||||
|
|
||||||
this._promptEntry = new St.Entry({ style_class: 'login-dialog-prompt-entry',
|
this._promptEntry = new St.Entry({ style_class: 'login-dialog-prompt-entry',
|
||||||
can_focus: true });
|
can_focus: true });
|
||||||
|
this._promptEntry.clutter_text.connect('activate', Lang.bind(this, this._doUnlock));
|
||||||
this._promptEntry.clutter_text.set_password_char('\u25cf');
|
this._promptEntry.clutter_text.set_password_char('\u25cf');
|
||||||
ShellEntry.addContextMenu(this._promptEntry, { isPassword: true });
|
ShellEntry.addContextMenu(this._promptEntry, { isPassword: true });
|
||||||
this.setInitialKeyFocus(this._promptEntry);
|
this.setInitialKeyFocus(this._promptEntry);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user