Details
-
Task
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
None
-
None
Description
Proof of concept patch: [1]
Text input protocol enables input method support at compositor-side. Qt Wayland implements the protocol but does not expose API for switching input method at run-time. Qt applications traditionally have selected input method at start up (set via QT_IM_MODULE) and did not offer a way to switch to a different input method at run-time. We have an accessor QPlatformIntegration::inputContext(), but do not have a setter.
Restarting an application to switch an input method might be inconvenient for some users, but to restart a text-input enabled compositor to switch, for example, from virtual keyboard to 'compose' input context is not acceptable user experience. Hence the need for this API.
Input context plugins might need some adjusting to take into consideration that they can be loaded at other time, not just on start up. E.g: https://codereview.qt-project.org/#/c/255896/
Notes #1:
The patch currently uses Proxy class, which is sub-optimal due to code duplication (see qwaylandcompositorintegration_p.h). Other option would be to introduce QPlatformIntegration::setInputContext(ctx). With multi-seat support it would look something more like:
QPlatformIntegration::setInputContext(device, ctx);
As a temporary solution to address the issue purely in Qt Wayland compositor and to avoid the mentioned bloat of proxy class, we can add override function in QPlatformIntegration::inputContext(). Pseudo code:
QPlatformIntegration::inputContext() { if (hasOverride) return inputContextOverride(); .. }
from qtwayland:
QPlatformIntegration::setOverride("inputContext", [] { logic from QWaylandCompositorIntegration::inputContext() (see https://codereview.qt-project.org/#/c/255673/1/src/compositor/compositor_api/qwaylandcompositorintegration.cpp) })
Note #2:
If vkb not created on startup (via QT_IM_MODULE=qtvirtualkeyboard) it uses the size of physical screen, instead of the size of the nested compositor. It could be an issue in qt wayland or in qtvirtualkeyboard plugin or in [1].
Attachments
Gerrit Reviews
For Gerrit Dashboard: QTBUG-74465 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
255673,2 | WIP: compositor: add API for switching input method at run-time | 5.13 | qt/qtwayland | Status: DEFERRED | -2 | 0 |
255896,4 | platforminputcontexts: future-proof compose plugin | 5.13 | qt/qtbase | Status: MERGED | +2 | 0 |