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

winex11: Set x11drv_win_data XIC out of X11DRV_CreateIC.

parent d84f8dcc
......@@ -2312,28 +2312,6 @@ Window X11DRV_get_whole_window( HWND hwnd )
/***********************************************************************
* X11DRV_get_ic
*
* Return the X input context associated with a window
*/
XIC X11DRV_get_ic( HWND hwnd )
{
struct x11drv_win_data *data = get_win_data( hwnd );
XIM xim;
XIC ret = 0;
if (data)
{
x11drv_thread_data()->last_xic_hwnd = hwnd;
ret = data->xic;
if (!ret && (xim = x11drv_thread_data()->xim)) ret = X11DRV_CreateIC( xim, hwnd, data );
release_win_data( data );
}
return ret;
}
/***********************************************************************
* X11DRV_GetDC (X11DRV.@)
*/
void X11DRV_GetDC( HDC hdc, HWND hwnd, HWND top, const RECT *win_rect,
......
......@@ -641,7 +641,6 @@ struct x11drv_win_data
extern struct x11drv_win_data *get_win_data( HWND hwnd ) DECLSPEC_HIDDEN;
extern void release_win_data( struct x11drv_win_data *data ) DECLSPEC_HIDDEN;
extern Window X11DRV_get_whole_window( HWND hwnd ) DECLSPEC_HIDDEN;
extern XIC X11DRV_get_ic( HWND hwnd ) DECLSPEC_HIDDEN;
extern Window get_dummy_parent(void) DECLSPEC_HIDDEN;
extern void sync_gl_drawable( HWND hwnd, BOOL known_child ) DECLSPEC_HIDDEN;
......@@ -820,9 +819,9 @@ extern struct x11drv_display_device_handler desktop_handler DECLSPEC_HIDDEN;
/* XIM support */
extern BOOL xim_init( const WCHAR *input_style ) DECLSPEC_HIDDEN;
extern XIC X11DRV_CreateIC( XIM xim, HWND hwnd, struct x11drv_win_data *data ) DECLSPEC_HIDDEN;
extern void xim_thread_attach( struct x11drv_thread_data *data ) DECLSPEC_HIDDEN;
extern void X11DRV_XIMLookupChars( const char *str, UINT count ) DECLSPEC_HIDDEN;
extern XIC X11DRV_get_ic( HWND hwnd ) DECLSPEC_HIDDEN;
#define XEMBED_MAPPED (1 << 0)
......
......@@ -448,7 +448,7 @@ static BOOL xic_destroy( XIC xic, XPointer user, XPointer arg )
return TRUE;
}
XIC X11DRV_CreateIC( XIM xim, HWND hwnd, struct x11drv_win_data *data )
static XIC xic_create( XIM xim, HWND hwnd, Window win )
{
XICCallback destroy = {.callback = xic_destroy, .client_data = (XPointer)hwnd};
XICCallback preedit_caret = {.callback = xic_preedit_caret, .client_data = (XPointer)hwnd};
......@@ -462,10 +462,9 @@ XIC X11DRV_CreateIC( XIM xim, HWND hwnd, struct x11drv_win_data *data )
XPoint spot = {0};
XVaNestedList preedit, status;
XIC xic;
Window win = data->whole_window;
XFontSet fontSet = x11drv_thread_data()->font_set;
TRACE( "xim %p, hwnd %p, data %p\n", xim, hwnd, data );
TRACE( "xim %p, hwnd %p/%lx\n", xim, hwnd, win );
preedit = XVaCreateNestedList( 0, XNFontSet, fontSet,
XNPreeditCaretCallback, &preedit_caret,
......@@ -483,10 +482,23 @@ XIC X11DRV_CreateIC( XIM xim, HWND hwnd, struct x11drv_win_data *data )
XNClientWindow, win, XNFocusWindow, win, XNDestroyCallback, &destroy, NULL );
TRACE( "created XIC %p\n", xic );
data->xic = xic;
XFree( preedit );
XFree( status );
return xic;
}
XIC X11DRV_get_ic( HWND hwnd )
{
struct x11drv_win_data *data;
XIM xim;
XIC ret;
if (!(data = get_win_data( hwnd ))) return 0;
x11drv_thread_data()->last_xic_hwnd = hwnd;
if (!(ret = data->xic) && (xim = x11drv_thread_data()->xim))
ret = data->xic = xic_create( xim, hwnd, data->whole_window );
release_win_data( data );
return ret;
}
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