authPrompt: Bump the user verifier timeout when wiggling the message
Wiggle may make the error message to be visible for less time so provide the auth prompt an API to increase the timeout to be used for showing a message in some cases. This could be reworked when we'll have a proper asyn wiggle function so that we could just make the user verifier to "freeze", then await for the wiggle transition to complete and eventually release the verifier. Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1652>
This commit is contained in:
parent
75a1798e75
commit
ed1ace1d99
@ -432,8 +432,16 @@ var AuthPrompt = GObject.registerClass({
|
||||
}
|
||||
|
||||
if (type === GdmUtil.MessageType.ERROR &&
|
||||
this._userVerifier.serviceIsFingerprint(serviceName))
|
||||
Util.wiggle(this._message);
|
||||
this._userVerifier.serviceIsFingerprint(serviceName)) {
|
||||
// TODO: Use Await for wiggle to be over before unfreezing the user verifier queue
|
||||
const wiggleParameters = {
|
||||
duration: 65,
|
||||
wiggleCount: 3,
|
||||
};
|
||||
this._userVerifier.increaseCurrentMessageTimeout(
|
||||
wiggleParameters.duration * (wiggleParameters.wiggleCount + 2));
|
||||
Util.wiggle(this._message, wiggleParameters);
|
||||
}
|
||||
}
|
||||
|
||||
updateSensitivity(sensitive) {
|
||||
|
@ -285,6 +285,11 @@ var ShellUserVerifier = class {
|
||||
this.emit('no-more-messages');
|
||||
}
|
||||
|
||||
increaseCurrentMessageTimeout(interval) {
|
||||
if (!this._messageQueueTimeoutId && interval > 0)
|
||||
this._currentMessageExtraInterval = interval;
|
||||
}
|
||||
|
||||
_queueMessageTimeout() {
|
||||
if (this._messageQueue.length == 0) {
|
||||
this.finishMessageQueue();
|
||||
@ -296,10 +301,11 @@ var ShellUserVerifier = class {
|
||||
|
||||
let message = this._messageQueue.shift();
|
||||
|
||||
delete this._currentMessageExtraInterval;
|
||||
this.emit('show-message', message.serviceName, message.text, message.type);
|
||||
|
||||
this._messageQueueTimeoutId = GLib.timeout_add(GLib.PRIORITY_DEFAULT,
|
||||
message.interval,
|
||||
message.interval + (this._currentMessageExtraInterval | 0),
|
||||
() => {
|
||||
this._messageQueueTimeoutId = 0;
|
||||
this._queueMessageTimeout();
|
||||
|
Loading…
Reference in New Issue
Block a user