screenShield: Close inhibitors that finished creation after uninhibition

There was a potential issue when suspend was inhibited and immediately
uninhibited again before the creation of the inhibitor has finished.
Then the new inhibitor would be kept active.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1927>
This commit is contained in:
Sebastian Keller 2021-08-05 07:22:07 +02:00 committed by Marge Bot
parent fb313033ea
commit 85075192f3

View File

@ -224,6 +224,12 @@ var ScreenShield = class {
else
this._inhibitor = inhibitor;
}
// Handle uninhibits that happened after the start
if (!this._inhibited) {
this._inhibitor?.close(null);
this._inhibitor = null;
}
});
} else {
this._inhibitor?.close(null);