<table><tr><td style="">graesslin created this revision.<br />graesslin added reviewers: KWin, Plasma on Wayland.<br />Restricted Application added subscribers: kwin, plasma-devel.<br />Restricted Application added projects: Plasma on Wayland, KWin.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D4220" rel="noreferrer">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>On X11 the SNI for keyboard layout is provided by the keyboard kded.<br />
On Wayland that kded has no real access to the layouts and cannot<br />
properly implement switching. Given that it's better to integrate the<br />
SNI directly in KWin.</p>
<p>The implementation of the SNI is largly based on the existing SNI from<br />
plasma-desktop/kcms/keyboard. The implementation so far supports:</p>
<ul class="remarkup-list">
<li class="remarkup-list-item">Switching to next layout on toggle</li>
<li class="remarkup-list-item">Presenting all layouts in a context menu</li>
<li class="remarkup-list-item">Switching to a specific layout through the context menu</li>
<li class="remarkup-list-item">Opening the keyboard layout configuration module</li>
</ul>
<p>Not yet supported are:</p>
<ul class="remarkup-list">
<li class="remarkup-list-item">config option whether to show the SNI</li>
<li class="remarkup-list-item">scroll on SNI</li>
<li class="remarkup-list-item">flags and/or short text for the layouts</li>
</ul>
<p>The last point needs more explanation. On X11 the layout name is<br />
something like "de" or "us". This can be directly mapped to a flag and<br />
can be added as a short note.</p>
<p>Xkbcommon does not provide this information directly. Instead it provides<br />
us the full name of the layout, e.g. "German" or "English (us)". There is<br />
no way in the API to go from "German" to "de".</p>
<p>Instead we need to parse the evdev.xml file to gather all information<br />
about layouts. This is already done in the keyboard kcm to configure<br />
layouts. The implementation needs to be split out into a small helper<br />
library.</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R108 KWin</div></div></div><br /><div><strong>BRANCH</strong><div><div>keyboard-layout-sni</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D4220" rel="noreferrer">https://phabricator.kde.org/D4220</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>keyboard_input.cpp<br />
keyboard_input.h<br />
keyboard_layout.cpp<br />
keyboard_layout.h</div></div></div><br /><div><strong>EMAIL PREFERENCES</strong><div><a href="https://phabricator.kde.org/settings/panel/emailpreferences/" rel="noreferrer">https://phabricator.kde.org/settings/panel/emailpreferences/</a></div></div><br /><div><strong>To: </strong>graesslin, KWin, Plasma on Wayland<br /><strong>Cc: </strong>plasma-devel, kwin, lesliezhai, ali-mohamed, hardening, jensreuterberg, abetts, eliasp, sebas<br /></div>