wayland: Allow configuring locale1 mode from kwinrc

KWin already supports following org.freedesktop.locale1 for the
keyboard keymap, but only by passing a command-line option. This is
typically used in SDDM when running the greeter in kwin_wayland.

We want to use locale1 mode in livesys environments too, so that
environment-agnostic installers can configure the keyboard and also
immediatly apply the same configuration to the running desktop.
When KWin is started through `startplasma` we cannot easily supply
an extra command-line option, so we need to make this configurable
from the external environment, in the form of a KConfig.

The command-line option will keep precedence over the KConfig.
This commit is contained in:
Alessandro Astone 2024-06-15 22:34:36 +02:00
parent 7e2d650c8f
commit 170b138026

View file

@ -472,6 +472,8 @@ int main(int argc, char *argv[])
if (parser.isSet(locale1Option)) {
a.setFollowLocale1(true);
} else {
a.setFollowLocale1(a.config()->group(QStringLiteral("Wayland")).readEntry("FollowLocale1", false));
}
bool ok = false;