diff options
| author | Huang Peng <shawn.p.huang@gmail.com> | 2008-08-16 19:09:42 +0800 |
|---|---|---|
| committer | Huang Peng <shawn.p.huang@gmail.com> | 2008-08-16 19:09:42 +0800 |
| commit | 5c5f5077439017b3e4d795fedc34e51053ba6d89 (patch) | |
| tree | e275c7d40f511136c812c7eb97e87b92265c4860 /client/x11 | |
| parent | b9af24711bc445854fdde8aaecf78ed2cb93c802 (diff) | |
| download | ibus-5c5f5077439017b3e4d795fedc34e51053ba6d89.tar.gz ibus-5c5f5077439017b3e4d795fedc34e51053ba6d89.tar.xz ibus-5c5f5077439017b3e4d795fedc34e51053ba6d89.zip | |
Fix wrong cursor position.
Diffstat (limited to 'client/x11')
| -rw-r--r-- | client/x11/main.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/client/x11/main.c b/client/x11/main.c index 5efee8c..798a2fa 100644 --- a/client/x11/main.c +++ b/client/x11/main.c @@ -375,7 +375,25 @@ xim_set_ic_values (XIMS xims, IMChangeICStruct *call_data) i = _xim_store_ic_values (x11ic, call_data); if (i) { - ibus_im_client_set_cursor_location (_client, x11ic->ibus_ic, &x11ic->preedit_area); + GdkRectangle preedit_area = x11ic->preedit_area; + Window w = x11ic->focus_window ? + x11ic->focus_window :x11ic->client_window; + if (w) { + XWindowAttributes xwa; + Window child; + + XGetWindowAttributes (GDK_DISPLAY(), w, &xwa); + XTranslateCoordinates (GDK_DISPLAY(), w, + xwa.root, + preedit_area.x, + preedit_area.y, + &preedit_area.x, + &preedit_area.y, + &child + ); + } + ibus_im_client_set_cursor_location (_client, + x11ic->ibus_ic, &preedit_area); } return i; |
