Diffusion KWin fe561c5c7def

Add a basic SNI for keyboard layout

Authored by graesslin on Jan 20 2017, 6:15 AM.

Description

Add a basic SNI for keyboard layout

Summary:
On X11 the SNI for keyboard layout is provided by the keyboard kded.
On Wayland that kded has no real access to the layouts and cannot
properly implement switching. Given that it's better to integrate the
SNI directly in KWin.

The implementation of the SNI is largly based on the existing SNI from
plasma-desktop/kcms/keyboard. The implementation so far supports:

  • Switching to next layout on toggle
  • Presenting all layouts in a context menu
  • Switching to a specific layout through the context menu
  • Opening the keyboard layout configuration module
  • scroll on SNI to switch layout
  • config option whether to show the SNI

Not yet supported are:

  • flags and/or short text for the layouts

The last point needs more explanation. On X11 the layout name is
something like "de" or "us". This can be directly mapped to a flag and
can be added as a short note.

Xkbcommon does not provide this information directly. Instead it provides
us the full name of the layout, e.g. "German" or "English (us)". There is
no way in the API to go from "German" to "de".

Instead we need to parse the evdev.xml file to gather all information
about layouts. This is already done in the keyboard kcm to configure
layouts. The implementation needs to be split out into a small helper
library.

Reviewers: KWin, Plasma on Wayland

Subscribers: plasma-devel, kwin

Tags: Plasma on Wayland, KWin

Differential Revision: https://phabricator.kde.org/D4220

Details

Committed
graesslinJan 25 2017, 1:00 PM
Differential Revision
D4220: Add a basic SNI for keyboard layout
Parents
R108:1173f190bc67: Merge branch 'Plasma/5.9'
Branches
Unknown
Tags
Unknown