This attempts to fix the problem I identified in #104 while also
not breaking for the case where there is no system source and
gnome_get_input_source_from_locale returns nothing. It should
implement the intended logic fully:
* If gnome-desktop gives us an input source, always preselect that
* If gnome-desktop gives us a keyboard layout and there's no
system sources, preselect the layout gnome-desktop gave us
* If there is a system source and we didn't get an input source
from gnome-desktop, preselect the system source
Signed-off-by: Adam Williamson <email address hidden>
(cherry picked from commit 3096b533bc5d07a86a79748cdefbe62b96d556b3)
695741d...
by
Will Thompson <email address hidden>
NEWS for 3.36.2
Suspiciously similar to the NEWS for 3.37.1!
ee2b414...
by
Philip Withnall <email address hidden>
keyboard: Fix use of uninitialised variables if localed properties unset
If localed returns a `NULL` list of sources, the code which was
introduced in commit 07e24d6f would go ahead and dereference the `id`
and `type` variables which hadn’t yet been set.
From reading the comment in `preselect_input_source()`, it looks like
the intention was to prefer the `system_sources` over the data returned
by `gnome_get_input_source_from_locale()` — if both were set. The code
didn’t properly handle the situation where either or both of them were
unset, though.
Signed-off-by: Philip Withnall <email address hidden>
(cherry picked from commit e5563bcce1123e5d079b7d5969f3be4013af2815)
6c36fba...
by
Philip Withnall <email address hidden>
keyboard: Nullify pointers if getting layout fails
It’s possible for `get_layout()` to fail if the wrong type is specified,
in which case the `layout` and `variant` pointers will be left dangling.
This might fix an occasional bug where the keyboard layout isn’t saved
correctly and warnings are spewed to the console about
```
g_variant_new_string: assertion 'g_utf8_validate (string, -1, NULL)' failed
```
Or it might not. I haven’t been able to reproduce that bug.
Signed-off-by: Philip Withnall <email address hidden>
(cherry picked from commit 954e0b150f5abe9b921a4bfc03f7607910e3e905)
2f7ceb3...
by
Will Thompson <email address hidden>
po: Sort LINGUAS
This file is conventionally kept in lexicographic order.
(cherry picked from commit cc86d02aea1d653e2e2bf5031748836a279d208d)