From 85075192f34060c20ed99271a73145d75b4a5e49 Mon Sep 17 00:00:00 2001 From: Sebastian Keller Date: Thu, 5 Aug 2021 07:22:07 +0200 Subject: [PATCH] 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: --- js/ui/screenShield.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/js/ui/screenShield.js b/js/ui/screenShield.js index de8b7f409..04353d93b 100644 --- a/js/ui/screenShield.js +++ b/js/ui/screenShield.js @@ -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);