../panels/region/cc-region-panel.c: In function 'set_restart_notification_visible':
../panels/region/cc-region-panel.c:131:17: warning: 'current_locale' may be used uninitialized [-Wmaybe-uninitialized]
131 | uselocale (current_locale);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
../panels/region/cc-region-panel.c:115:18: note: 'current_locale' was declared here
115 | locale_t current_locale;
| ^~~~~~~~~~~~~~
../panels/region/cc-region-panel.c:130:34: warning: 'new_locale' may be used uninitialized [-Wmaybe-uninitialized]
130 | if (locale && new_locale != (locale_t) 0) {
| ~~~~~~~~~~~^~~~~~~~~~~~~~~
../panels/region/cc-region-panel.c:114:18: note: 'new_locale' was declared here
114 | locale_t new_locale;
| ^~~~~~~~~~
Changing user’s language resets the formats (region) by passing `NULL` to `update_region`.
However, updating the region calls `maybe_notify`, whose callback `maybe_notify_finish`
tries to parse the `mnd->target_locale` (the `NULL`), producing a critical:
GLib-CRITICAL **: g_regex_match_full: assertion 'string != NULL' failed
Since updating the language itself already triggers the notification check,
let’s just skip calling `maybe_notify` here in that case.
Rework the panel to have 2 groups: the user's language and
format; and the login screen's language and format. Remove
the now unused bottom label explainig the login screen.
Special-casing of single user systems is still present.
Related: https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1587
...on the title bar with joined toggles (like in Background panel) for a
clearer UI.
Note 2020-08-26: This patch has been in Endless OS since 2014. It seems
like a good UX change, so I'm proposing it upstream with some minor
changes. - mwleeds
Not doing this will lead to (probably undesired) inconsistencies when
changing the language, since many locale-dependant strings will still be
rendered considering the previous language format (e.g. days of the week).
Note 2020-08-26: This patch has been in Endless OS since 2015, proposing
it upstream. - mwleeds
Make the panel class provide a cancellable that will be cancelled when the panel
is destroyed. Panel implementations can use this and not have to mangage the
cancellable themselves. Consolidate cases where panels had multiple cancellables
that were all being used for this behaviour.
localed will not update the LC_* variables if they are not given. This
means that should the user switch the formats away from LANG and then
back, they will not be reset appropriately.
Simply always setting the variables even if the match will fix this.
setlocale() is not threadsafe except when used only to query the locale
without changing it. Let's use uselocale() instead, which changes the
locale only on the calling thread. Much better.
This was broken in a86cf1eca2 (3.32) when the input options dialog was converted
into a GtkPopover. Previously two GSettings objects were used, with one set to
'delay-apply' mode. The input source option didn't apply the changes.
The 'delay-apply' mode is from the original commit d3852fc831, however code was
simplified in b3199dd to only set one setting. This meant that the delay is no
longer necessary.
Fixes#440
- Move more code into the .ui file
- Don't save the dialog between runs - it's cheap to generate on demand
- Hold references on data passed to dialog
- Connect signals in "swapped" form
- Use standard naming format for signal callbacks
The previous code had a number of issues:
- It used a shared 'op' enum value for the operation - a second operation would
overwrite this.
- It acted on the row selected at the time the operation was requested - this
could have changed by the time the operation occurred.
Solved by passing all the required data though the async methods.
The row widgets are not full GtkWidgets. This means they are harder
to understand, use g_object_set_data which looses type safety and
cause the one .c file to be overly large.
Update this code to use a CcInputRow widget that uses GTK+ best
practice.
Creating the restart file leaked GFile objects. It also stored the path in the
object, which is unnecessary as it can just be generated on demand.
This leak has was introduced when the feature was in
db551f1c5d
There was a GCancellable used for IBus operations that was generated each time
an operation was done. The cancellable was only used to cancel such operations
when the panel is closed. We can just use the shared cancellable for this.