GNOME Bugzilla – Bug 732241
Move user's input sources out of GSettings and into AccountsService
Last modified: 2021-07-05 14:47:29 UTC
The user's input sources are currently stored in GSettings under org.gnome.desktop.input-sources. But we might want to access a particular user's input sources from outside the session at some point (e.g. in the greeter). Also, the current type of (ss) for an input source is insufficient for specifying combinations of keyboard layout and input method (e.g. IBus libpinyin on a French AZERTY layout), or specifying per-source-specific options (e.g. having two US layouts, but with one having the esperanto:qwerty XKB option). For more background, as well as the patch to be applied to AccountsService, see the aa{ss} patch at https://bugs.freedesktop.org/show_bug.cgi?id=63086. This affects gnome-settings-daemon, gnome-control-center, and gnome-shell.
Created attachment 279241 [details] [review] gnome-settings-daemon patch This is for gnome-settings-daemon to migrate the user's current input sources from GSettings to AccountsService.
Created attachment 279242 [details] [review] gnome-settings-daemon patch This is for gnome-settings-daemon to migrate the user's current input sources from GSettings to AccountsService.
Created attachment 279244 [details] [review] gnome-control-center patch 1 This is for gnome-control-center to read and write input sources directly to AccountsService.
Created attachment 279245 [details] [review] gnome-control-center patch 2 This is for gnome-control-center to store input sources as true dictionaries with type a{ss} instead of (ss).
Created attachment 279246 [details] [review] gnome-shell patch This is for gnome-shell to use the input sources from AccountsService instead of GSettings.
Created attachment 279247 [details] [review] gnome-shell patch This is for gnome-shell to use the input sources from AccountsService instead of GSettings.
A couple of high-level notes: I think we want to move away from storing the current index in GSettings, for a couple of reasons. The first is that we simply do not want to restore the keyboard layout that happened to be in use the last time the system was shutdown (or crashed) as the default next time we login. We want to use the user's designated (explicitly selected) default. This is particularly important when we may have the user typing using this layout at the password prompt: predictable behaviour is extremely important here. Another reason is that it feels sort of strange that anyone who wants to implement a switcher/monitor/etc. of any kind needs to consult two separate sources: the list of things stored in accountsservice (which can be contacted by the system bus) and the currently selected one stored in GSettings. I think we need some sort of a keyboard layouts D-Bus service living in gnome-settings-daemon (makes most sense for X11) or gnome-shell (makes most sense for Wayland) that maintains a list of the user's possible layouts and allows switching between them, all in one interface. This interface is additionally complicated by the question of how to deal with per-window layout switching. Do we expose that as the layout changing every time we do an alt-tab, or do we have a list of layouts keyed by window IDs and expect the indicator to know which is the currently focused window?
Hi William, thanks for the patches. I didn't comment yet because you submitted this exactly when I was moving most of what g-s-d does into gnome-shell/mutter (that's because I want the same logic working for both the wayland and x11 compositor cases). Basically, the g-c-c patches should be usable and I will review them soon but the others conflict pretty badly so we'll need to re-work them. (In reply to comment #7) > I think we want to move away from storing the current index in GSettings, for a > couple of reasons. The first is that we simply do not want to restore the > keyboard layout that happened to be in use the last time the system was > shutdown (or crashed) as the default next time we login. We want to use the > user's designated (explicitly selected) default. This is particularly > important when we may have the user typing using this layout at the password > prompt: predictable behaviour is extremely important here. Yes, the way I have it working right is basically this. I've stopped using the index in gsettings completely making the current input source effectively a run-time only thing. Moving the list of input sources to accounts-service shouldn't be hard on top of this. > Another reason is that it feels sort of strange that anyone who wants to > implement a switcher/monitor/etc. of any kind needs to consult two separate > sources: the list of things stored in accountsservice (which can be contacted > by the system bus) and the currently selected one stored in GSettings. > > I think we need some sort of a keyboard layouts D-Bus service living in > gnome-settings-daemon (makes most sense for X11) or gnome-shell (makes most > sense for Wayland) that maintains a list of the user's possible layouts and > allows switching between them, all in one interface. This interface is > additionally complicated by the question of how to deal with per-window layout > switching. Do we expose that as the layout changing every time we do an > alt-tab, or do we have a list of layouts keyed by window IDs and expect the > indicator to know which is the currently focused window? I'm not really interested in making this available through any API tbh, unless someone comes up with a very compelling reason to do so. One of the things that made me decide in moving all the logic into mutter/gnome-shell is exactly so that we don't have to ping-pong through DBus and keep an API etc.
Created attachment 280018 [details] [review] gnome-control-center patch 1 This is for gnome-control-center to read and write input sources directly to AccountsService.
Created attachment 280019 [details] [review] gnome-control-center patch 2 This is for gnome-control-center to store input sources as true dictionaries with type a{ss} instead of (ss).
Created attachment 280020 [details] [review] gnome-control-center patch 3 This is for adding buttons to gnome-control-center that select the primary input source.
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org. As part of that, we are mass-closing older open tickets in bugzilla.gnome.org which have not seen updates for a longer time (resources are unfortunately quite limited so not every ticket can get handled). If you can still reproduce the situation described in this ticket in a recent and supported software version, then please follow https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines and create a new ticket at https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/ Thank you for your understanding and your help.