diff options
author | Gatis Paeglis <gatis.paeglis@qt.io> | 2018-12-13 12:14:59 +0100 |
---|---|---|
committer | Gatis Paeglis <gatis.paeglis@qt.io> | 2019-04-15 14:10:28 +0000 |
commit | 3aedd01271dc4f4a13103d632df224971ab2b6df (patch) | |
tree | c4e5b95e00fb1051ae26d151adfe80f9de19092d /src/client/client.pro | |
parent | 1b773df93f5bccb6b616d2a228cb15cffe8e32d5 (diff) | |
download | qtwayland-3aedd01271dc4f4a13103d632df224971ab2b6df.tar.gz |
client: rework input method handling
The existing solution was parsing compose tables on startup, it is
better to lazy initialize the compose table/state on a first key press,
instead of doing it on an application startup. This logic is inside of
the compose input plugin.
The existing code did not utilize correctly how Qt handles complex text
input. It used libxkbcommon-compose APIs to compose user input and then
passed the same input again to QPlatformInputContext (from
QWaylandInputDevice::Keyboard::sendKey), which was erroneous. This also
means that code was forcing "xkb compose", and did not respect QT_IM_MODULE
at client-side.
From commit that added compose key handling (57c4af2b18c0fb1d266b245a107fa6cb876b9d9e):
"We should expand on it in the future to handle things like resetting
the compose state on text field switching".
This is now handled by properly utilizing Qt IM framework.
Converted QWaylandInputDevice::Keyboard::sendKey into a class member function
to avoid adding one more arg (mXkbContext) to the already long argument list.
That whole function should be simplified, but that is out-of-scope for this
patch.
The reworked code uses qxkbcommon support library to reduce code duplication
between platforms and to unify behavior.
Some users might mistakenly think that this patch introduces a regression
with Qt on KDE, but it is actually a KWin/Wayland compositor bug:
https://bugs.kde.org/show_bug.cgi?id=405388
The work around on KDE is to use QT_IM_MODULE at client-side to select
input method, as KWin compositor over the wire supports only the qtvirtualkeyboard
module. Setting this envvar is not someting out of the ordinary for users
on Linux. Input method handling at compositor-side is new feature and
clearly not very well supported yet.
Task-number: QTBUG-65503
Change-Id: Ie511d950396fa2fb6cbe6672996cee9791f3ab11
Reviewed-by: Johan Helsing <johan.helsing@qt.io>
Diffstat (limited to 'src/client/client.pro')
-rw-r--r-- | src/client/client.pro | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/client/client.pro b/src/client/client.pro index 38d0ac3e..9f7d979d 100644 --- a/src/client/client.pro +++ b/src/client/client.pro @@ -15,8 +15,9 @@ use_gold_linker: CONFIG += no_linker_version_script CONFIG -= precompile_header CONFIG += link_pkgconfig wayland-scanner -qtConfig(xkbcommon): \ - QMAKE_USE_PRIVATE += xkbcommon +qtConfig(xkbcommon) { + QT_PRIVATE += xkbcommon_support-private +} qtHaveModule(linuxaccessibility_support_private): \ QT += linuxaccessibility_support_private |