-
Notifications
You must be signed in to change notification settings - Fork 842
Description
Distribution
Mint 22.3
Package version
6.6.7
Graphics hardware in use
Intel Corporation Core Processor Integrated Graphics Controller hp630
Frequency
Always
Bug description
Related to #13635
When editing the custom date or tooltip format string in the calendar applet
settings, the UI becomes unresponsive/frozen while typing. This is caused by
the format field applying and validating the format string live on every
keystroke, flooding the error loop when the string is temporarily invalid
mid-edit.
Steps to reproduce
-
Right-click the calendar/clock applet → Configure
-
Enable "Use a custom date format"
-
Click into either the "Date format" or "Date format for tooltip" field
-
Type slowly, character by character
-
Observe the settings window becoming sluggish or frozen
-
Observe the following error repeated rapidly in ~/.xsession-errors:
[LookingGlass/error] Calendar applet: bad time format string - check your string.
Expected behavior
The format string should only be applied and validated after the user has
finished typing — not on every single keystroke. A debounce delay of
~500ms after the last keystroke would prevent the error flood and keep
the UI responsive.
Actual behavior:
Every keystroke immediately triggers _updateClockAndDate(), which calls
get_clock_for_format() on the partially-typed (and therefore invalid)
string. This floods the GLib main loop with errors on every keypress,
making the settings UI unresponsive.
Additional information
Suggested fix:
Debounce the format string input field so validation and application only
triggers after the user stops typing for ~500ms:
if (this._format_debounce_id) {
Mainloop.source_remove(this._format_debounce_id);
}
this._format_debounce_id = Mainloop.timeout_add(500, () => {
this._updateFormatString();
this._updateClockAndDate();
this._format_debounce_id = 0;
});