winex11: Send an internal WM_IME_NOTIFY wparam to set open status.

This commit is contained in:
Rémi Bernon 2023-04-01 11:56:58 +02:00 committed by Alexandre Julliard
parent 5d0526d298
commit 4e92c57221
7 changed files with 21 additions and 19 deletions

View file

@ -40,6 +40,7 @@ static const char *debugstr_imn( WPARAM wparam )
case IMN_SETCOMPOSITIONWINDOW: return "IMN_SETCOMPOSITIONWINDOW";
case IMN_GUIDELINE: return "IMN_GUIDELINE";
case IMN_SETSTATUSWINDOWPOS: return "IMN_SETSTATUSWINDOWPOS";
case IMN_WINE_SET_OPEN_STATUS: return "IMN_WINE_SET_OPEN_STATUS";
default: return wine_dbg_sprintf( "%#Ix", wparam );
}
}
@ -337,6 +338,20 @@ static void ime_ui_start_composition( HIMC himc, HWND hwnd )
ImmUnlockIMC( himc );
}
static LRESULT ime_ui_notify( HIMC himc, HWND hwnd, WPARAM wparam, LPARAM lparam )
{
TRACE( "himc %p, hwnd %p, wparam %s, lparam %#Ix\n", hwnd, himc, debugstr_imn(wparam), lparam );
switch (wparam)
{
case IMN_WINE_SET_OPEN_STATUS:
return ImmSetOpenStatus( himc, lparam );
default:
FIXME( "himc %p, hwnd %p, wparam %s, lparam %#Ix stub!\n", hwnd, himc, debugstr_imn(wparam), lparam );
return 0;
}
}
static LRESULT WINAPI ime_ui_window_proc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam )
{
HIMC himc = (HIMC)GetWindowLongPtrW( hwnd, IMMGWL_IMC );
@ -379,9 +394,7 @@ static LRESULT WINAPI ime_ui_window_proc( HWND hwnd, UINT msg, WPARAM wparam, LP
ShowWindow( hwnd, SW_HIDE );
break;
case WM_IME_NOTIFY:
FIXME( "hwnd %p, himc %p, msg %s, wparam %s, lparam %#Ix stub!\n", hwnd, himc,
debugstr_wm_ime(msg), debugstr_imn(wparam), lparam );
return 0;
return ime_ui_notify( himc, hwnd, wparam, lparam );
case WM_IME_CONTROL:
FIXME( "hwnd %p, himc %p, msg %s, wparam %s, lparam %#Ix stub!\n", hwnd, himc,
debugstr_wm_ime(msg), debugstr_imc(wparam), lparam );

View file

@ -32,7 +32,6 @@ static const callback_func callback_funcs[] =
x11drv_dnd_leave_event,
x11drv_ime_set_composition_status,
x11drv_ime_set_cursor_pos,
x11drv_ime_set_open_status,
x11drv_ime_update_association,
};

View file

@ -516,15 +516,6 @@ BOOL WINAPI ImeSelect(HIMC hIMC, BOOL fSelect)
/* Interfaces to XIM and other parts of winex11drv */
NTSTATUS x11drv_ime_set_open_status( UINT open )
{
HIMC imc;
imc = RealIMC(FROM_X11);
ImmSetOpenStatus(imc, open);
return 0;
}
NTSTATUS x11drv_ime_set_composition_status( UINT open )
{
HIMC imc;

View file

@ -96,7 +96,6 @@ enum client_callback
client_dnd_leave_event,
client_ime_set_composition_status,
client_ime_set_cursor_pos,
client_ime_set_open_status,
client_ime_update_association,
client_funcs_count
};

View file

@ -38,7 +38,6 @@ extern NTSTATUS x11drv_dnd_drop_event( UINT arg ) DECLSPEC_HIDDEN;
extern NTSTATUS x11drv_dnd_leave_event( 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;
extern NTSTATUS x11drv_ime_update_association( UINT arg ) DECLSPEC_HIDDEN;
extern LRESULT WINAPI foreign_window_proc( HWND hwnd, UINT msg, WPARAM wparam,

View file

@ -122,12 +122,10 @@ static BOOL xic_preedit_state_notify( XIC xic, XPointer user, XPointer arg )
switch (state)
{
case XIMPreeditEnable:
x11drv_client_call( client_ime_set_open_status, TRUE );
send_message( hwnd, WM_IME_NOTIFY, IMN_WINE_SET_OPEN_STATUS, TRUE );
break;
case XIMPreeditDisable:
x11drv_client_call( client_ime_set_open_status, FALSE );
break;
default:
send_message( hwnd, WM_IME_NOTIFY, IMN_WINE_SET_OPEN_STATUS, FALSE );
break;
}

View file

@ -492,6 +492,9 @@ enum wine_internal_message
#define IME_INTERNAL_HKL_ACTIVATE 0x19
#define IME_INTERNAL_HKL_DEACTIVATE 0x20
/* internal WM_IME_NOTIFY wparams, not compatible with Windows */
#define IMN_WINE_SET_OPEN_STATUS 0x000f
/* builtin IME driver calls */
enum wine_ime_call
{