Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
92015467
Commit
92015467
authored
Apr 25, 2023
by
Rémi Bernon
Committed by
Alexandre Julliard
Apr 27, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
imm32: Update IME UI window IMMGWL_IMC when focus or HIMC changes.
parent
b5c30f8e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
10 deletions
+20
-10
imm.c
dlls/imm32/imm.c
+17
-7
imm32.c
dlls/imm32/tests/imm32.c
+3
-3
No files found.
dlls/imm32/imm.c
View file @
92015467
...
...
@@ -972,11 +972,18 @@ static HWND get_ime_ui_window(void)
{
imc
->
ui_hwnd
=
CreateWindowExW
(
WS_EX_TOOLWINDOW
,
ime
->
ui_class
,
NULL
,
WS_POPUP
,
0
,
0
,
1
,
1
,
ImmGetDefaultIMEWnd
(
0
),
0
,
ime
->
module
,
0
);
SetWindowLongPtrW
(
imc
->
ui_hwnd
,
IMMGWL_IMC
,
(
LONG_PTR
)
imc
->
handle
);
SetWindowLongPtrW
(
imc
->
ui_hwnd
,
IMMGWL_IMC
,
(
LONG_PTR
)
NtUserGetWindowInputContext
(
GetFocus
()
)
);
}
return
imc
->
ui_hwnd
;
}
static
void
set_ime_ui_window_himc
(
HIMC
himc
)
{
HWND
hwnd
;
if
(
!
(
hwnd
=
get_ime_ui_window
()))
return
;
SetWindowLongPtrW
(
hwnd
,
IMMGWL_IMC
,
(
LONG_PTR
)
himc
);
}
/***********************************************************************
* ImmCreateContext (IMM32.@)
*/
...
...
@@ -1021,6 +1028,7 @@ HIMC WINAPI ImmAssociateContext( HWND hwnd, HIMC new_himc )
{
ImmSetActiveContext
(
hwnd
,
old_himc
,
FALSE
);
ImmSetActiveContext
(
hwnd
,
new_himc
,
TRUE
);
if
(
hwnd
==
GetFocus
())
set_ime_ui_window_himc
(
new_himc
);
}
return
ret
==
AICR_FAILED
?
0
:
old_himc
;
...
...
@@ -1056,6 +1064,7 @@ BOOL WINAPI ImmAssociateContextEx( HWND hwnd, HIMC new_himc, DWORD flags )
{
ImmSetActiveContext
(
hwnd
,
old_himc
,
FALSE
);
ImmSetActiveContext
(
hwnd
,
new_himc
,
TRUE
);
if
(
hwnd
==
GetFocus
())
set_ime_ui_window_himc
(
new_himc
);
}
return
ret
!=
AICR_FAILED
;
...
...
@@ -2683,15 +2692,12 @@ BOOL WINAPI ImmSetConversionStatus( HIMC himc, DWORD conversion, DWORD sentence
BOOL
WINAPI
ImmSetOpenStatus
(
HIMC
himc
,
BOOL
status
)
{
INPUTCONTEXT
*
ctx
;
HWND
ui_hwnd
;
TRACE
(
"himc %p, status %u
\n
"
,
himc
,
status
);
if
(
NtUserQueryInputContext
(
himc
,
NtUserInputContextThreadId
)
!=
GetCurrentThreadId
())
return
FALSE
;
if
(
!
(
ctx
=
ImmLockIMC
(
himc
)))
return
FALSE
;
if
((
ui_hwnd
=
get_ime_ui_window
()))
SetWindowLongPtrW
(
ui_hwnd
,
IMMGWL_IMC
,
(
LONG_PTR
)
himc
);
if
(
status
!=
ctx
->
fOpen
)
{
ctx
->
fOpen
=
status
;
...
...
@@ -3240,11 +3246,15 @@ static LRESULT ime_internal_msg( WPARAM wparam, LPARAM lparam)
switch
(
wparam
)
{
case
IME_INTERNAL_ACTIVATE
:
hwnd
=
(
HWND
)
lparam
;
himc
=
NtUserGetWindowInputContext
(
hwnd
);
ImmSetActiveContext
(
hwnd
,
himc
,
TRUE
);
set_ime_ui_window_himc
(
himc
);
break
;
case
IME_INTERNAL_DEACTIVATE
:
hwnd
=
(
HWND
)
lparam
;
himc
=
ImmGetContext
(
hwnd
);
ImmSetActiveContext
(
hwnd
,
himc
,
wparam
==
IME_INTERNAL_ACTIVATE
);
ImmReleaseContext
(
hwnd
,
himc
);
himc
=
NtUserGetWindowInputContext
(
hwnd
);
ImmSetActiveContext
(
hwnd
,
himc
,
FALSE
);
break
;
case
IME_INTERNAL_HKL_ACTIVATE
:
ImmEnumInputContext
(
0
,
enum_activate_layout
,
0
);
...
...
dlls/imm32/tests/imm32.c
View file @
92015467
...
...
@@ -4566,9 +4566,9 @@ static void test_ImmSetOpenStatus(void)
ok_ne
(
NULL
,
ime_windows
.
ime_ui_hwnd
,
HWND
,
"%p"
);
ok_eq
(
default_himc
,
(
HIMC
)
GetWindowLongPtrW
(
ime_windows
.
ime_ui_hwnd
,
IMMGWL_IMC
),
HIMC
,
"%p"
);
ok_ret
(
1
,
ImmSetOpenStatus
(
himc
,
TRUE
)
);
todo_wine
ok_eq
(
default_himc
,
(
HIMC
)
GetWindowLongPtrW
(
ime_windows
.
ime_ui_hwnd
,
IMMGWL_IMC
),
HIMC
,
"%p"
);
ok_eq
(
default_himc
,
(
HIMC
)
GetWindowLongPtrW
(
ime_windows
.
ime_ui_hwnd
,
IMMGWL_IMC
),
HIMC
,
"%p"
);
ok_ret
(
1
,
ImmSetOpenStatus
(
himc
,
FALSE
)
);
todo_wine
ok_eq
(
default_himc
,
(
HIMC
)
GetWindowLongPtrW
(
ime_windows
.
ime_ui_hwnd
,
IMMGWL_IMC
),
HIMC
,
"%p"
);
ok_eq
(
default_himc
,
(
HIMC
)
GetWindowLongPtrW
(
ime_windows
.
ime_ui_hwnd
,
IMMGWL_IMC
),
HIMC
,
"%p"
);
ok_ret
(
1
,
ImmDestroyContext
(
himc
)
);
memset
(
ime_calls
,
0
,
sizeof
(
ime_calls
)
);
ime_call_count
=
0
;
...
...
@@ -5331,7 +5331,7 @@ static void test_ImmSetActiveContext(void)
ctx
->
hWnd
=
0
;
ok_eq
(
default_himc
,
ImmAssociateContext
(
hwnd
,
himc
),
HIMC
,
"%p"
);
todo_wine
ok_eq
(
himc
,
(
HIMC
)
GetWindowLongPtrW
(
ime_windows
.
ime_ui_hwnd
,
IMMGWL_IMC
),
HIMC
,
"%p"
);
ok_eq
(
himc
,
(
HIMC
)
GetWindowLongPtrW
(
ime_windows
.
ime_ui_hwnd
,
IMMGWL_IMC
),
HIMC
,
"%p"
);
ok_ret
(
0
,
IsWindowVisible
(
ime_windows
.
ime_ui_hwnd
)
);
ok_eq
(
hwnd
,
ctx
->
hWnd
,
HWND
,
"%p"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment