How to correctly use the PreeditPosition input style

27 views
Skip to first unread message

Sam Varshavchik

unread,
Apr 19, 2017, 10:11:02 PM4/19/17
to ibus-devel
I'm trying to code my own XIM client, as a hobby. Based on XIM protocol specification, and XLIB documentation here's what I'm doing:

1. I am selecting the XIMPreeditPosition|XIMStatusNothing input style, the first style listed in queryInputStyle.

2. I am setting and updating spotLocation and area.

However, ibus 1.5.14 always shows its preedit window below my main window, instead of near the "spotLocation" attribute. I am not getting any XIM_ERROR messages. XIM_SET_IC_VALUES, with each "spotLocation" and "area" attribute update, gets acknowledged without any complaints.

Am I missing some detail, some required step that I need to make? Everything appears to be working fine; the input method is working, just that the preedit area is ignoring what I'm setting for the "spotLocation" attribute.

One thing that wasn't quite clear to me is why the "area" attribute needs to be set. It seems that setting spotLocation alone would be sufficient information to inform the XIM server where in the focus window input is being entered; area seems to be redundant. I'm setting "area" to indicate where in the focuswindow the cursor is blinking, with "spotLocation" being its south-west corner. Also, my focuswindow and clientwindow is the same, it's just one large window.

Thanks for any pointers.

Takao Fujiwara

unread,
Apr 21, 2017, 1:11:04 AM4/21/17
to ibus-...@googlegroups.com
ibus-x11 gets the preedit position from XNSpotLocation:
https://github.com/ibus/ibus/blob/master/client/x11/main.c#L295

Probably I think it would be better to refer xterm source codes.

Fujiwara
> --
> --
> You received this message because you are subscribed to the Google
> Groups "ibus-devel" group.
> iBus project web page: http://code.google.com/p/ibus/
> iBus dev group: http://groups.google.com/group/ibus-devel?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "ibus-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ibus-devel+...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages