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
cf03ab41
Commit
cf03ab41
authored
Apr 06, 2023
by
Rémi Bernon
Committed by
Alexandre Julliard
Apr 13, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
imm32: Use INPUTCONTEXT directly in ImmSetCandidateWindow.
parent
93b6c455
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
24 deletions
+20
-24
imm.c
dlls/imm32/imm.c
+19
-23
imm32.c
dlls/imm32/tests/imm32.c
+1
-1
No files found.
dlls/imm32/imm.c
View file @
cf03ab41
...
...
@@ -127,6 +127,14 @@ static const char *debugstr_composition( const COMPOSITIONFORM *composition )
wine_dbgstr_rect
(
&
composition
->
rcArea
)
);
}
static
const
char
*
debugstr_candidate
(
const
CANDIDATEFORM
*
candidate
)
{
if
(
!
candidate
)
return
"(null)"
;
return
wine_dbg_sprintf
(
"idx %#lx, style %#lx, pos %s, area %s"
,
candidate
->
dwIndex
,
candidate
->
dwStyle
,
wine_dbgstr_point
(
&
candidate
->
ptCurrentPos
),
wine_dbgstr_rect
(
&
candidate
->
rcArea
)
);
}
static
BOOL
ime_is_unicode
(
const
struct
ime
*
ime
)
{
return
!!
(
ime
->
info
.
fdwProperty
&
IME_PROP_UNICODE
);
...
...
@@ -827,13 +835,6 @@ static void imc_send_message( struct imc *imc, TRANSMSG *message )
SendMessageW
(
target
,
message
->
message
,
message
->
wParam
,
message
->
lParam
);
}
static
LRESULT
imc_notify_ime
(
struct
imc
*
imc
,
WPARAM
notify
,
LPARAM
lparam
)
{
HWND
target
;
if
(
!
(
target
=
imc
->
IMC
.
hWnd
)
&&
!
(
target
=
GetFocus
()))
return
0
;
return
SendMessageW
(
target
,
WM_IME_NOTIFY
,
notify
,
lparam
);
}
/***********************************************************************
* ImmSetActiveContext (IMM32.@)
*/
...
...
@@ -2429,29 +2430,24 @@ LRESULT WINAPI ImmRequestMessageW(HIMC hIMC, WPARAM wParam, LPARAM lParam)
/***********************************************************************
* ImmSetCandidateWindow (IMM32.@)
*/
BOOL
WINAPI
ImmSetCandidateWindow
(
HIMC
hIMC
,
LPCANDIDATEFORM
lpCandidate
)
BOOL
WINAPI
ImmSetCandidateWindow
(
HIMC
himc
,
CANDIDATEFORM
*
candidate
)
{
struct
imc
*
data
=
get_imc_data
(
hIMC
)
;
INPUTCONTEXT
*
ctx
;
TRACE
(
"(%p, %p)
\n
"
,
hIMC
,
lpCandidate
);
TRACE
(
"hwnd %p, candidate %s
\n
"
,
himc
,
debugstr_candidate
(
candidate
)
);
if
(
!
data
||
!
lpCandidate
)
return
FALSE
;
if
(
!
candidate
)
return
FALSE
;
if
(
candidate
->
dwIndex
>=
ARRAY_SIZE
(
ctx
->
cfCandForm
))
return
FALSE
;
if
(
NtUserQueryInputContext
(
hIMC
,
NtUserInputContextThreadId
)
!=
GetCurrentThreadId
())
return
FALSE
;
if
(
NtUserQueryInputContext
(
himc
,
NtUserInputContextThreadId
)
!=
GetCurrentThreadId
())
return
FALSE
;
if
(
!
(
ctx
=
ImmLockIMC
(
himc
)))
return
FALSE
;
TRACE
(
"
\t
%lx, %lx, %s, %s
\n
"
,
lpCandidate
->
dwIndex
,
lpCandidate
->
dwStyle
,
wine_dbgstr_point
(
&
lpCandidate
->
ptCurrentPos
),
wine_dbgstr_rect
(
&
lpCandidate
->
rcArea
));
ctx
->
cfCandForm
[
candidate
->
dwIndex
]
=
*
candidate
;
if
(
lpCandidate
->
dwIndex
>=
ARRAY_SIZE
(
data
->
IMC
.
cfCandForm
))
return
FALSE
;
ImmNotifyIME
(
himc
,
NI_CONTEXTUPDATED
,
0
,
IMC_SETCANDIDATEPOS
);
SendMessageW
(
ctx
->
hWnd
,
WM_IME_NOTIFY
,
IMN_SETCANDIDATEPOS
,
1
<<
candidate
->
dwIndex
)
;
data
->
IMC
.
cfCandForm
[
lpCandidate
->
dwIndex
]
=
*
lpCandidate
;
ImmNotifyIME
(
hIMC
,
NI_CONTEXTUPDATED
,
0
,
IMC_SETCANDIDATEPOS
);
imc_notify_ime
(
data
,
IMN_SETCANDIDATEPOS
,
1
<<
lpCandidate
->
dwIndex
);
ImmUnlockIMC
(
himc
);
return
TRUE
;
}
...
...
dlls/imm32/tests/imm32.c
View file @
cf03ab41
...
...
@@ -6442,7 +6442,7 @@ static void test_ImmSetCandidateWindow(void)
.
hkl
=
expect_ime
,
.
himc
=
0
/*himc*/
,
.
func
=
IME_NOTIFY
,
.
notify
=
{.
action
=
NI_CONTEXTUPDATED
,
.
index
=
0
,
.
value
=
IMC_SETCANDIDATEPOS
},
},
{
.
todo
=
TRUE
},
{
0
},
};
CANDIDATEFORM
cand_form
,
expect_form
=
{
...
...
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