Input method and input/output redirect under wayland
yyc1992 at gmail.com
Mon Aug 27 18:02:26 PDT 2012
How can the proposed input method system support the input method
server drawing a window around the cursor for user interaction?
For some input method (especially for CJK), it is important to have
some user interaction before some text is finally committed (e.g.
there might be more than one candidate words for a single input
string), and for better user experience, it is important to show this
window (for user interaction) closed to the cursor and in a way
consistent with the input window.
This is supported in X11 simply by sending the current cursor position
to the input method server (through either xim or dbus-based toolkit
specific im modules). However, things can get more complicated in
First of all, afaik, there is no way for a wayland client to know
where it's window is on the screen and is also not aware of other
windows (ok, it can get these information for if the compositor expose
a api for that, but a im server shouldn't relay this much on a
specific window manager). Therefore, if the im system use toolkit
im-module, since both the im-server and im-client are wayland-client,
the server will have no idea where to draw that interaction window.
Moreover, since wayland support input and output redirection, the
window (although it might be a rectangle for the client) might not
appears to be a normal rectangle on the screen. They may be tilted,
scaled, or they may not be a rectangle or not even in a 2D plan at
all. In such cases, the "position" of the window (say if the input
method get this information from the wayland im protocol) can make no
sense at all (and it is also not practical to let the im server
transform it's window).
A practical thing the im server can do is to let the compositor
transform/redirect it's window, in the same way with the input window
and the input method will just need to provide the relative position
with the input window.
Is there any plans/ideas on such a protocol or how such job can be
done? And please correct me if any of my understanding of the wayland
protocol/client/compositor/etc. is wrong.
More information about the wayland-devel