Lock screen triggers g_error() when animations are disabled
Affected version
master
Bug summary
The lock screen crashes when animations are disabled.
Steps to reproduce
-
Disable animations:
$ gsettings set org.gnome.desktop.interface enable-animations false
-
Lock the screen
-
Bring up the auth prompt (click, esc, ...)
What happened
The shell aborts with
(gnome-shell:61155): Clutter-ERROR **: 19:01:10.075: ClutterBoxLayout child <unnamed>[<Gjs_ui_shellEntry_CapsLockWarning>:0x4fc1c80] natural height: 0.000000 < minimum 25.000000 for width 337.000000
== Stack trace for context 0x1bba4b0 ==
#0 1e4ff18 i resource:///org/gnome/shell/ui/unlockDialog.js:446 (29ce17946088 @ 1590)
Additional observations
Trying out the polkit dialog with animations disabled turns out to be fine, including toggling caps lock on/off.
Overriding vfunc_get_preferred_height()
of CapsLockWarning
shows it only requests sane values (nat > min > 0).
The following diff for some reason "fixes" the crash:
diff --git a/js/ui/shellEntry.js b/js/ui/shellEntry.js
index c1a1f1134..cf6953ce8 100644
--- a/js/ui/shellEntry.js
+++ b/js/ui/shellEntry.js
@@ -193,7 +193,6 @@ class CapsLockWarning extends St.Label {
this.natural_height_set = false;
let [, height] = this.get_preferred_height(-1);
- this.natural_height_set = true;
this.ease({
height: capsLockOn ? height : 0,
The above breaks some animations, so it's not an actual fix. This on the other hand might be, but I need to investigate some more:
diff --git a/js/ui/shellEntry.js b/js/ui/shellEntry.js
index c1a1f1134..38f5a836d 100644
--- a/js/ui/shellEntry.js
+++ b/js/ui/shellEntry.js
@@ -191,9 +191,10 @@ class CapsLockWarning extends St.Label {
this.remove_all_transitions();
+ const { naturalHeightSet } = this;
this.natural_height_set = false;
let [, height] = this.get_preferred_height(-1);
- this.natural_height_set = true;
+ this.natural_height_set = naturalHeightSet;
this.ease({
height: capsLockOn ? height : 0,