[gnome-shell/wip/smcv/issue3071-3.36] unlockDialog: Defend against absence of blur effect
- From: Simon McVittie <smcv src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/wip/smcv/issue3071-3.36] unlockDialog: Defend against absence of blur effect
- Date: Sat, 15 Aug 2020 14:02:26 +0000 (UTC)
commit 701b924d54bc1634af9df7703bf222bf36fe5c38
Author: Zephaniah E. Loss-Cutler-Hull <warp aehallh com>
Date: Sat Aug 15 03:23:27 2020 -0700
unlockDialog: Defend against absence of blur effect
widget.get_effect(...) can return null while locking the screen, resulting
in a TypeError. In this situation the screen ends up black with a cursor
but never going to sleep, and moving the mouse brings the old screen
contents up but does not allow unlocking.
unlockDialog.js assumes that widget.get_effect will return non-null,
but other places such as getWindowDimmer in windowManager.js go out of
their way to be more careful.
[smcv: Add commit message, remove hard tabs]
Resolves: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3071
Bug-Debian: https://bugs.debian.org/968440
js/ui/unlockDialog.js | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/js/ui/unlockDialog.js b/js/ui/unlockDialog.js
index a074c6fc4c..5f8c665e1e 100644
--- a/js/ui/unlockDialog.js
+++ b/js/ui/unlockDialog.js
@@ -648,10 +648,14 @@ var UnlockDialog = GObject.registerClass({
const themeContext = St.ThemeContext.get_for_stage(global.stage);
for (const widget of this._backgroundGroup.get_children()) {
- widget.get_effect('blur').set({
- brightness: BLUR_BRIGHTNESS,
- sigma: BLUR_SIGMA * themeContext.scale_factor,
- });
+ let effect = widget.get_effect('blur')
+
+ if (effect) {
+ effect.set({
+ brightness: BLUR_BRIGHTNESS,
+ sigma: BLUR_SIGMA * themeContext.scale_factor,
+ });
+ }
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]