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

winex11: Always create XIC preedit and status attributes.

parent 41fa67c6
...@@ -452,8 +452,7 @@ static BOOL X11DRV_DestroyIC(XIC xic, XPointer p, XPointer data) ...@@ -452,8 +452,7 @@ static BOOL X11DRV_DestroyIC(XIC xic, XPointer p, XPointer data)
XIC X11DRV_CreateIC(XIM xim, struct x11drv_win_data *data) XIC X11DRV_CreateIC(XIM xim, struct x11drv_win_data *data)
{ {
XPoint spot = {0}; XPoint spot = {0};
XVaNestedList preedit = NULL; XVaNestedList preedit, status;
XVaNestedList status = NULL;
XIC xic; XIC xic;
XICCallback destroy = {(XPointer)data, X11DRV_DestroyIC}; XICCallback destroy = {(XPointer)data, X11DRV_DestroyIC};
XICCallback P_StateNotifyCB, P_StartCB, P_DoneCB, P_DrawCB, P_CaretCB; XICCallback P_StateNotifyCB, P_StartCB, P_DoneCB, P_DrawCB, P_CaretCB;
...@@ -474,88 +473,22 @@ XIC X11DRV_CreateIC(XIM xim, struct x11drv_win_data *data) ...@@ -474,88 +473,22 @@ XIC X11DRV_CreateIC(XIM xim, struct x11drv_win_data *data)
P_DrawCB.callback = (XICProc)XIMPreEditDrawCallback; P_DrawCB.callback = (XICProc)XIMPreEditDrawCallback;
P_CaretCB.callback = (XICProc)XIMPreEditCaretCallback; P_CaretCB.callback = (XICProc)XIMPreEditCaretCallback;
if ((ximStyle & (XIMPreeditNothing | XIMPreeditNone)) == 0) preedit = XVaCreateNestedList( 0, XNFontSet, fontSet,
{ XNPreeditCaretCallback, &P_CaretCB,
preedit = XVaCreateNestedList(0, XNPreeditDoneCallback, &P_DoneCB,
XNFontSet, fontSet, XNPreeditDrawCallback, &P_DrawCB,
XNSpotLocation, &spot, XNPreeditStartCallback, &P_StartCB,
XNPreeditStateNotifyCallback, &P_StateNotifyCB, XNPreeditStateNotifyCallback, &P_StateNotifyCB,
XNPreeditStartCallback, &P_StartCB, XNSpotLocation, &spot, NULL );
XNPreeditDoneCallback, &P_DoneCB, status = XVaCreateNestedList( 0, XNFontSet, fontSet, NULL );
XNPreeditDrawCallback, &P_DrawCB, xic = XCreateIC( xim, XNInputStyle, ximStyle, XNPreeditAttributes, preedit, XNStatusAttributes, status,
XNPreeditCaretCallback, &P_CaretCB, XNClientWindow, win, XNFocusWindow, win, XNDestroyCallback, &destroy, NULL );
NULL); TRACE( "created XIC %p\n", xic );
TRACE("preedit = %p\n", preedit);
}
else
{
preedit = XVaCreateNestedList(0,
XNPreeditStateNotifyCallback, &P_StateNotifyCB,
XNPreeditStartCallback, &P_StartCB,
XNPreeditDoneCallback, &P_DoneCB,
XNPreeditDrawCallback, &P_DrawCB,
XNPreeditCaretCallback, &P_CaretCB,
NULL);
TRACE("preedit = %p\n", preedit);
}
if ((ximStyle & (XIMStatusNothing | XIMStatusNone)) == 0)
{
status = XVaCreateNestedList(0,
XNFontSet, fontSet,
NULL);
TRACE("status = %p\n", status);
}
if (preedit != NULL && status != NULL)
{
xic = XCreateIC(xim,
XNInputStyle, ximStyle,
XNPreeditAttributes, preedit,
XNStatusAttributes, status,
XNClientWindow, win,
XNFocusWindow, win,
XNDestroyCallback, &destroy,
NULL);
}
else if (preedit != NULL)
{
xic = XCreateIC(xim,
XNInputStyle, ximStyle,
XNPreeditAttributes, preedit,
XNClientWindow, win,
XNFocusWindow, win,
XNDestroyCallback, &destroy,
NULL);
}
else if (status != NULL)
{
xic = XCreateIC(xim,
XNInputStyle, ximStyle,
XNStatusAttributes, status,
XNClientWindow, win,
XNFocusWindow, win,
XNDestroyCallback, &destroy,
NULL);
}
else
{
xic = XCreateIC(xim,
XNInputStyle, ximStyle,
XNClientWindow, win,
XNFocusWindow, win,
XNDestroyCallback, &destroy,
NULL);
}
TRACE("xic = %p\n", xic);
data->xic = xic; data->xic = xic;
if (preedit != NULL) XFree( preedit );
XFree(preedit); XFree( status );
if (status != NULL)
XFree(status);
return xic; return xic;
} }
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