When running in "existing user" mode (which isn't done upstream, but
Debian and Ubuntu re-enable it because they don't have GNOME Tour),
the window title is visible in Alt+[key above Tab] and the Overview.
It defaults to "gnome-initial-setup", but looks better if we reuse the
translated name from the .desktop file.
Signed-off-by: Simon McVittie <email address hidden>
(cherry picked from commit 2ed2453476bc62501896083109c542cf407c7ae1)
keyboard: Update filter and sort when the display name changes
The display name in `InputWidget.name` can affect `sort_inputs()`
and `input_visible()`, so we should update it when we replace the
placeholder display name with the real one, and tell GTK to update its
state accordingly.
Signed-off-by: Simon McVittie <email address hidden>
(cherry picked from commit be66eb8af619e3785a90b83b48c4d187b7eb433c)
keyboard: Correctly update labels for IBus engines
After the port from GTK 3 to 4, in general there's an additional level
of indirection: the children of priv->input_list are GtkListBoxRow
objects containing the widget whose user-data is the InputWidget. This
means we didn't find the InputWidget and therefore couldn't update its
display name.
Unfortunately, there is one exception to the rule that every child
of a GtkListBox is a GtkListBoxRow: the placeholder object, in our
case priv->no_results, is not wrapped in a GtkListBoxRow (see also
GNOME/gtk#4523). This means that walking the GtkWidget tree seems rather
fragile: it's difficult to tell whether each child of the GtkListBox
is a GtkListBoxRow, or the placeholder object priv->no_results, or
some third type of object that could be added by a future GTK version
(particularly since there is no particular type-safety here).
Instead of walking the widget tree, maintain our own parallel list of
known keyboard layouts and other input methods. For this list, we can
safely assert that every item is something that we put there, with the
invariant that it's a GtkBox with an InputWidget attached.
This means that we can reliably find the InputWidget, and update its
associated display name.
15f88b9...
by
Will Thompson <email address hidden>
keyboard: Resort & refilter list when picking shortlist
Each row of the keyboard layout/input method list has a flag for whether
it is an "extra" layout, hidden by default, or not. All rows are added
with the is_extra flag set to TRUE; later, they can be marked as
non-extra in a few ways:
- The currently-selected layout is (indirectly) marked as non-extra
- Selecting a layout marks it as non-extra
- 5 semi-arbitrary layouts are marked as non-extra
To make the list work, the GtkListBox has sort and filter functions set:
- The sort function sorts extra layouts after non-extra layouts
- The filter function hides extra layouts, unless the user is searching
or has clicked the vertical ellipsis to see all layouts
But previously, the sort and filter of the list were not always
invalidated when one or more layouts' is_extra flags were changed. As a
result, the list always showed no layouts by default, just the vertical
ellipsis to see all layouts.
Fix this by invalidating both sort and filter when a layout is marked
non-extra.
Fixes #165
(cherry picked from commit 151688f670e8c6f5ecc8a7bac686ddcc815cdf11)
0f26bb1...
by
Will Thompson <email address hidden>
Add StartupWMClass to .desktop file
Initial Setup's application ID is org.gnome.InitialSetup. This does not
match the desktop file name. It is too late in the current development
cycle to rename the desktop file to match.
Instead, allow the shell to associate the initial setup window with its
desktop file by specifying StartupWMClass.