Commit 61219f1b authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

imm32: Call ImeSelect from ImmLockIMC with current IME.

parent de432361
......@@ -2829,14 +2829,17 @@ DWORD WINAPI ImmGetImeMenuItemsW( HIMC himc, DWORD flags, DWORD type, IMEMENUITE
/***********************************************************************
* ImmLockIMC(IMM32.@)
*/
LPINPUTCONTEXT WINAPI ImmLockIMC(HIMC hIMC)
INPUTCONTEXT *WINAPI ImmLockIMC( HIMC himc )
{
struct imc *data = get_imc_data( hIMC );
struct imc *imc = get_imc_data( himc );
if (!data)
return NULL;
data->dwLock++;
return &data->IMC;
TRACE( "himc %p\n", himc );
if (!imc) return NULL;
imc->dwLock++;
imc_select_hkl( imc, GetKeyboardLayout( 0 ) );
return &imc->IMC;
}
/***********************************************************************
......
......@@ -3798,7 +3798,6 @@ static void test_ImmActivateLayout(void)
{
.hkl = expect_ime, .himc = default_himc,
.func = IME_SELECT, .select = 1,
.todo = TRUE,
},
{0},
};
......@@ -3816,6 +3815,15 @@ static void test_ImmActivateLayout(void)
},
{0},
};
const struct ime_call activate_with_window_seq[] =
{
{
.hkl = expect_ime, .himc = default_himc,
.func = IME_SELECT, .select = 1,
.todo = TRUE,
},
{0},
};
HKL hkl, old_hkl = GetKeyboardLayout( 0 );
UINT ret;
......@@ -3843,7 +3851,6 @@ static void test_ImmActivateLayout(void)
SET_EXPECT( ImeInquire );
ok_ret( 1, ImmActivateLayout( hkl ) );
ok_seq( activate_seq );
todo_wine
CHECK_CALLED( ImeInquire );
ok_eq( hkl, GetKeyboardLayout( 0 ), HKL, "%p" );
......@@ -3851,8 +3858,10 @@ static void test_ImmActivateLayout(void)
ok_ret( 1, ImmActivateLayout( hkl ) );
ok_seq( empty_sequence );
todo_ImeDestroy = TRUE; /* Wine doesn't leak the IME */
ok_ret( 1, ImmActivateLayout( old_hkl ) );
ok_seq( deactivate_seq );
todo_ImeDestroy = FALSE;
ok_eq( old_hkl, GetKeyboardLayout( 0 ), HKL, "%p" );
......@@ -3865,7 +3874,6 @@ static void test_ImmActivateLayout(void)
SET_EXPECT( ImeDestroy );
ret = ImmFreeLayout( hkl );
ok( ret, "ImmFreeLayout returned %u\n", ret );
todo_wine
CHECK_CALLED( ImeDestroy );
ok_seq( empty_sequence );
......@@ -3883,7 +3891,7 @@ static void test_ImmActivateLayout(void)
ok_eq( old_hkl, ActivateKeyboardLayout( hkl, 0 ), HKL, "%p" );
todo_wine
CHECK_CALLED( ImeInquire );
ok_seq( activate_seq );
ok_seq( activate_with_window_seq );
ok_eq( hkl, GetKeyboardLayout( 0 ), HKL, "%p" );
......@@ -3919,12 +3927,12 @@ static void test_ImmCreateInputContext(void)
{
.hkl = expect_ime, .himc = default_himc,
.func = IME_SELECT, .select = 1,
.todo = TRUE, .flaky_himc = TRUE,
.flaky_himc = TRUE,
},
{
.hkl = expect_ime, .himc = 0/*himc[0]*/,
.func = IME_SELECT, .select = 1,
.todo = TRUE, .flaky_himc = TRUE,
.flaky_himc = TRUE,
},
{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