Commit 5d0526d2 authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

winex11: Keep track of the cursor position on the XIM side.

The caret callback is rarely used and XIM also doesn't support changing the preedit string, so we cannot support composition string updates from the PE side either. Requesting only the cursor position, is then likely not useful.
parent e70b1b72
......@@ -30,7 +30,6 @@ static const callback_func callback_funcs[] =
{
x11drv_dnd_drop_event,
x11drv_dnd_leave_event,
x11drv_ime_get_cursor_pos,
x11drv_ime_set_composition_status,
x11drv_ime_set_cursor_pos,
x11drv_ime_set_open_status,
......
......@@ -550,26 +550,6 @@ NTSTATUS x11drv_ime_set_composition_status( UINT open )
return 0;
}
NTSTATUS x11drv_ime_get_cursor_pos( UINT arg )
{
LPINPUTCONTEXT lpIMC;
INT rc = 0;
LPCOMPOSITIONSTRING compstr;
if (!hSelectedFrom)
return rc;
lpIMC = LockRealIMC(FROM_X11);
if (lpIMC)
{
compstr = ImmLockIMCC(lpIMC->hCompStr);
rc = compstr->dwCursorPos;
ImmUnlockIMCC(lpIMC->hCompStr);
}
UnlockRealIMC(FROM_X11);
return rc;
}
NTSTATUS x11drv_ime_set_cursor_pos( UINT pos )
{
LPINPUTCONTEXT lpIMC;
......
......@@ -94,7 +94,6 @@ enum client_callback
{
client_dnd_drop_event,
client_dnd_leave_event,
client_ime_get_cursor_pos,
client_ime_set_composition_status,
client_ime_set_cursor_pos,
client_ime_set_open_status,
......
......@@ -36,7 +36,6 @@ extern NTSTATUS WINAPI x11drv_systray_change_owner( void *params, ULONG size ) D
extern NTSTATUS x11drv_dnd_drop_event( UINT arg ) DECLSPEC_HIDDEN;
extern NTSTATUS x11drv_dnd_leave_event( UINT arg ) DECLSPEC_HIDDEN;
extern NTSTATUS x11drv_ime_get_cursor_pos( UINT arg ) DECLSPEC_HIDDEN;
extern NTSTATUS x11drv_ime_set_composition_status( UINT arg ) DECLSPEC_HIDDEN;
extern NTSTATUS x11drv_ime_set_cursor_pos( UINT pos ) DECLSPEC_HIDDEN;
extern NTSTATUS x11drv_ime_set_open_status( UINT open ) DECLSPEC_HIDDEN;
......
......@@ -201,6 +201,7 @@ static int xic_preedit_draw( XIC xic, XPointer user, XPointer arg )
static int xic_preedit_caret( XIC xic, XPointer user, XPointer arg )
{
static int xim_caret_pos;
XIMPreeditCaretCallbackStruct *params = (void *)arg;
HWND hwnd = (HWND)user;
int pos;
......@@ -209,7 +210,7 @@ static int xic_preedit_caret( XIC xic, XPointer user, XPointer arg )
if (!params) return 0;
pos = x11drv_client_call( client_ime_get_cursor_pos, 0 );
pos = xim_caret_pos;
switch (params->direction)
{
case XIMForwardChar:
......@@ -238,7 +239,7 @@ static int xic_preedit_caret( XIC xic, XPointer user, XPointer arg )
break;
}
x11drv_client_call( client_ime_set_cursor_pos, pos );
params->position = pos;
params->position = xim_caret_pos = pos;
return 0;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment