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
dc02e4d1
Commit
dc02e4d1
authored
Jan 09, 2012
by
Kusanagi Kouichi
Committed by
Alexandre Julliard
Jan 11, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11.drv: Fix IME status handling.
parent
f56e1fcf
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
68 deletions
+42
-68
ime.c
dlls/winex11.drv/ime.c
+25
-35
x11drv.h
dlls/winex11.drv/x11drv.h
+3
-2
xim.c
dlls/winex11.drv/xim.c
+14
-31
No files found.
dlls/winex11.drv/ime.c
View file @
dc02e4d1
...
...
@@ -719,32 +719,21 @@ BOOL WINAPI NotifyIME(HIMC hIMC, DWORD dwAction, DWORD dwIndex, DWORD dwValue)
case
IMC_SETOPENSTATUS
:
TRACE
(
"IMC_SETOPENSTATUS
\n
"
);
/* Indirectly called from XIM callbacks */
if
(
ImmGetIMCCLockCount
(
lpIMC
->
hPrivate
)
>
0
)
bRet
=
TRUE
;
X11DRV_SetPreeditState
(
lpIMC
->
hWnd
,
lpIMC
->
fOpen
);
if
(
!
lpIMC
->
fOpen
)
{
bRet
=
TRUE
;
break
;
}
LPIMEPRIVATE
myPrivate
;
bRet
=
X11DRV_SetPreeditState
(
lpIMC
->
hWnd
,
lpIMC
->
fOpen
);
if
(
bRet
)
{
if
(
!
lpIMC
->
fOpen
)
myPrivate
=
ImmLockIMCC
(
lpIMC
->
hPrivate
);
if
(
myPrivate
->
bInComposition
)
{
LPIMEPRIVATE
myPrivate
;
myPrivate
=
ImmLockIMCC
(
lpIMC
->
hPrivate
);
if
(
myPrivate
->
bInComposition
)
{
X11DRV_ForceXIMReset
(
lpIMC
->
hWnd
);
GenerateIMEMessage
(
hIMC
,
WM_IME_ENDCOMPOSITION
,
0
,
0
);
myPrivate
->
bInComposition
=
FALSE
;
}
ImmUnlockIMCC
(
lpIMC
->
hPrivate
);
X11DRV_ForceXIMReset
(
lpIMC
->
hWnd
);
GenerateIMEMessage
(
hIMC
,
WM_IME_ENDCOMPOSITION
,
0
,
0
);
myPrivate
->
bInComposition
=
FALSE
;
}
ImmUnlockIMCC
(
lpIMC
->
hPrivate
);
}
else
lpIMC
->
fOpen
=
!
lpIMC
->
fOpen
;
break
;
default:
FIXME
(
"Unknown
\n
"
);
break
;
...
...
@@ -957,7 +946,15 @@ DWORD WINAPI ImeGetImeMenuItems(HIMC hIMC, DWORD dwFlags, DWORD dwType,
/* Interfaces to XIM and other parts of winex11drv */
void
IME_SetOpenStatus
(
BOOL
fOpen
,
BOOL
force
)
void
IME_SetOpenStatus
(
BOOL
fOpen
)
{
HIMC
imc
;
imc
=
RealIMC
(
FROM_X11
);
ImmSetOpenStatus
(
imc
,
fOpen
);
}
void
IME_SetCompositionStatus
(
BOOL
fOpen
)
{
HIMC
imc
;
LPINPUTCONTEXT
lpIMC
;
...
...
@@ -970,20 +967,18 @@ void IME_SetOpenStatus(BOOL fOpen, BOOL force)
myPrivate
=
ImmLockIMCC
(
lpIMC
->
hPrivate
);
if
(
!
fOpen
&&
myPrivate
->
bInComposition
)
if
(
fOpen
&&
!
myPrivate
->
bInComposition
)
{
GenerateIMEMessage
(
imc
,
WM_IME_STARTCOMPOSITION
,
0
,
0
);
}
else
if
(
!
fOpen
&&
myPrivate
->
bInComposition
)
{
ShowWindow
(
myPrivate
->
hwndDefault
,
SW_HIDE
);
ImmDestroyIMCC
(
lpIMC
->
hCompStr
);
lpIMC
->
hCompStr
=
ImeCreateBlankCompStr
();
myPrivate
->
bInComposition
=
FALSE
;
GenerateIMEMessage
(
imc
,
WM_IME_ENDCOMPOSITION
,
0
,
0
);
}
if
(
lpIMC
->
fOpen
&&
fOpen
)
ImmSetOpenStatus
(
imc
,
FALSE
);
if
(
fOpen
||
force
)
ImmSetOpenStatus
(
imc
,
fOpen
);
myPrivate
->
bInComposition
=
fOpen
;
ImmUnlockIMCC
(
lpIMC
->
hPrivate
);
ImmUnlockIMC
(
imc
);
...
...
@@ -1059,7 +1054,6 @@ void IME_SetResultString(LPWSTR lpResult, DWORD dwResultLen)
LPINPUTCONTEXT
lpIMC
;
HIMCC
newCompStr
;
LPIMEPRIVATE
myPrivate
;
BOOL
fOpen
;
imc
=
RealIMC
(
FROM_X11
);
lpIMC
=
ImmLockIMC
(
imc
);
...
...
@@ -1071,15 +1065,11 @@ void IME_SetResultString(LPWSTR lpResult, DWORD dwResultLen)
lpIMC
->
hCompStr
=
newCompStr
;
myPrivate
=
ImmLockIMCC
(
lpIMC
->
hPrivate
);
fOpen
=
lpIMC
->
fOpen
;
ImmSetOpenStatus
(
imc
,
TRUE
);
if
(
!
myPrivate
->
bInComposition
)
GenerateIMEMessage
(
imc
,
WM_IME_STARTCOMPOSITION
,
0
,
0
);
GenerateIMEMessage
(
imc
,
WM_IME_COMPOSITION
,
0
,
GCS_RESULTSTR
);
if
(
!
myPrivate
->
bInComposition
)
GenerateIMEMessage
(
imc
,
WM_IME_ENDCOMPOSITION
,
0
,
0
);
if
(
!
fOpen
)
ImmSetOpenStatus
(
imc
,
FALSE
);
ImmUnlockIMCC
(
lpIMC
->
hPrivate
);
ImmUnlockIMC
(
imc
);
...
...
dlls/winex11.drv/x11drv.h
View file @
dc02e4d1
...
...
@@ -289,7 +289,8 @@ extern BOOL destroy_glxpixmap(Display *display, XID glxpixmap) DECLSPEC_HIDDEN;
/* IME support */
extern
void
IME_UnregisterClasses
(
void
)
DECLSPEC_HIDDEN
;
extern
void
IME_SetOpenStatus
(
BOOL
fOpen
,
BOOL
force
)
DECLSPEC_HIDDEN
;
extern
void
IME_SetOpenStatus
(
BOOL
fOpen
)
DECLSPEC_HIDDEN
;
extern
void
IME_SetCompositionStatus
(
BOOL
fOpen
)
DECLSPEC_HIDDEN
;
extern
INT
IME_GetCursorPos
(
void
)
DECLSPEC_HIDDEN
;
extern
void
IME_SetCursorPos
(
DWORD
pos
)
DECLSPEC_HIDDEN
;
extern
void
IME_UpdateAssociation
(
HWND
focus
)
DECLSPEC_HIDDEN
;
...
...
@@ -716,7 +717,7 @@ extern XIC X11DRV_CreateIC(XIM xim, struct x11drv_win_data *data) DECLSPEC_HIDDE
extern
void
X11DRV_SetupXIM
(
void
)
DECLSPEC_HIDDEN
;
extern
void
X11DRV_XIMLookupChars
(
const
char
*
str
,
DWORD
count
)
DECLSPEC_HIDDEN
;
extern
void
X11DRV_ForceXIMReset
(
HWND
hwnd
)
DECLSPEC_HIDDEN
;
extern
BOOL
X11DRV_SetPreeditState
(
HWND
hwnd
,
BOOL
fOpen
)
DECLSPEC_HIDDEN
;
extern
void
X11DRV_SetPreeditState
(
HWND
hwnd
,
BOOL
fOpen
)
DECLSPEC_HIDDEN
;
#define XEMBED_MAPPED (1 << 0)
...
...
dlls/winex11.drv/xim.c
View file @
dc02e4d1
...
...
@@ -129,10 +129,10 @@ static BOOL XIMPreEditStateNotifyCallback(XIC xic, XPointer p, XPointer data)
switch
(
state
)
{
case
XIMPreeditEnable
:
IME_SetOpenStatus
(
TRUE
,
TRUE
);
IME_SetOpenStatus
(
TRUE
);
break
;
case
XIMPreeditDisable
:
IME_SetOpenStatus
(
FALSE
,
TRUE
);
IME_SetOpenStatus
(
FALSE
);
break
;
default:
break
;
...
...
@@ -143,7 +143,7 @@ static BOOL XIMPreEditStateNotifyCallback(XIC xic, XPointer p, XPointer data)
static
int
XIMPreEditStartCallback
(
XIC
ic
,
XPointer
client_data
,
XPointer
call_data
)
{
TRACE
(
"PreEditStartCallback %p
\n
"
,
ic
);
IME_Set
OpenStatus
(
TRUE
,
FALS
E
);
IME_Set
CompositionStatus
(
TRU
E
);
ximInComposeMode
=
TRUE
;
return
-
1
;
}
...
...
@@ -157,7 +157,7 @@ static void XIMPreEditDoneCallback(XIC ic, XPointer client_data, XPointer call_d
dwCompStringSize
=
0
;
dwCompStringLength
=
0
;
CompositionString
=
NULL
;
IME_Set
OpenStatus
(
FALSE
,
FALSE
);
IME_Set
CompositionStatus
(
FALSE
);
}
static
void
XIMPreEditDrawCallback
(
XIM
ic
,
XPointer
client_data
,
...
...
@@ -264,48 +264,31 @@ void X11DRV_ForceXIMReset(HWND hwnd)
}
}
BOOL
X11DRV_SetPreeditState
(
HWND
hwnd
,
BOOL
fOpen
)
void
X11DRV_SetPreeditState
(
HWND
hwnd
,
BOOL
fOpen
)
{
XIC
ic
;
XIMPreeditState
state
;
XVaNestedList
attr_set
,
attr_get
;
BOOL
ret
;
XVaNestedList
attr
;
ic
=
X11DRV_get_ic
(
hwnd
);
if
(
!
ic
)
return
FALSE
;
return
;
if
(
fOpen
)
state
=
XIMPreeditEnable
;
else
state
=
XIMPreeditDisable
;
ret
=
FALSE
;
wine_tsx11_lock
();
attr_set
=
XVaCreateNestedList
(
0
,
XNPreeditState
,
state
,
NULL
);
if
(
attr_set
==
NULL
)
goto
error1
;
attr_get
=
XVaCreateNestedList
(
0
,
XNPreeditState
,
&
state
,
NULL
);
if
(
attr_get
==
NULL
)
goto
error2
;
if
(
XSetICValues
(
ic
,
XNPreeditAttributes
,
attr_set
,
NULL
)
!=
NULL
)
goto
error3
;
/* SCIM claims it supports XNPreeditState, but seems to ignore */
state
=
XIMPreeditUnKnown
;
ret
=
XGetICValues
(
ic
,
XNPreeditAttributes
,
attr_get
,
NULL
)
==
NULL
&&
((
fOpen
&&
state
==
XIMPreeditEnable
)
||
(
!
fOpen
&&
state
==
XIMPreeditDisable
));
error3:
XFree
(
attr_get
);
error2:
XFree
(
attr_set
);
error1:
attr
=
XVaCreateNestedList
(
0
,
XNPreeditState
,
state
,
NULL
);
if
(
attr
!=
NULL
)
{
XSetICValues
(
ic
,
XNPreeditAttributes
,
attr
,
NULL
);
XFree
(
attr
);
}
wine_tsx11_unlock
();
return
ret
;
}
...
...
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