[keyboard] Add kwin-specific configuration flag

Running `kwin_wayland --locale1` makes KWin listen to locale1
for keyboard updates, but not everybody has that. Introduce a
KWin-specific configuration flag that will (re)write the
KWin configuration.
This commit is contained in:
Adriaan de Groot 2024-09-07 09:25:45 -04:00
parent 4fea2920d7
commit 5414e51245
4 changed files with 23 additions and 0 deletions

View File

@ -714,6 +714,11 @@ Config::setConfigurationMap( const QVariantMap& configurationMap )
m_convertedKeymapPath = getString( configurationMap, "convertedKeymapPath" );
m_configureEtcDefaultKeyboard = getBool( configurationMap, "writeEtcDefaultKeyboard", true );
m_configureLocale1 = getBool( configurationMap, "useLocale1", !isX11 );
bool bogus = false;
const auto configureItems = getSubMap( configurationMap, "configure", bogus );
m_configureKWin = getBool( configureItems, "kwin", false );
m_guessLayout = getBool( configurationMap, "guessLayout", true );
}

View File

@ -121,6 +121,7 @@ private:
bool m_configureXkb = true;
bool m_configureEtcDefaultKeyboard = true;
bool m_configureLocale1 = false;
bool m_configureKWin = false;
bool m_guessLayout = false;
// The state determines whether we guess settings or preserve them:

View File

@ -31,3 +31,15 @@ convertedKeymapPath: "/lib/kbd/keymaps/xkb"
# Guess the default layout from the user locale. If false, keeps the current
# OS keyboard layout as the default (useful if the layout is pre-configured).
#guessLayout: true
# Things that should be configured.
configure:
# Configure KWin (KDE Plasma) directly by editing the
# configuration file and informing KWin over DBus. This is
# useful in a system that uses Wayland but does **not** connect
# locale1 with KWin.
#
# Systems that use KDE Plasma Wayland and locale1 can instead start the
# compositor KWin with command-line argument `--locale1`. That
# argument makes this configuration option unnecessary.
kwin: false

View File

@ -11,4 +11,9 @@ properties:
writeEtcDefaultKeyboard: { type: boolean, default: true }
useLocale1: { type: boolean, default: false }
guessLayout: { type: boolean, default: true }
configure:
additionalProperties: false
type: object
properties:
kwin: { type: boolean, default: false }
required: [ xOrgConfFileName, convertedKeymapPath ]