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

winex11: Create the thread XFontSet on thread attach.

parent cc8a6b13
...@@ -820,9 +820,9 @@ extern BOOL X11DRV_DisplayDevices_SupportEventHandlers(void) DECLSPEC_HIDDEN; ...@@ -820,9 +820,9 @@ extern BOOL X11DRV_DisplayDevices_SupportEventHandlers(void) DECLSPEC_HIDDEN;
extern struct x11drv_display_device_handler desktop_handler DECLSPEC_HIDDEN; extern struct x11drv_display_device_handler desktop_handler DECLSPEC_HIDDEN;
/* XIM support */ /* XIM support */
extern BOOL X11DRV_InitXIM( const WCHAR *input_style ) DECLSPEC_HIDDEN; 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 XIC X11DRV_CreateIC( XIM xim, HWND hwnd, struct x11drv_win_data *data ) DECLSPEC_HIDDEN;
extern void X11DRV_SetupXIM(void) 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 void X11DRV_XIMLookupChars( const char *str, UINT count ) DECLSPEC_HIDDEN;
#define XEMBED_MAPPED (1 << 0) #define XEMBED_MAPPED (1 << 0)
......
...@@ -707,7 +707,7 @@ static NTSTATUS x11drv_init( void *arg ) ...@@ -707,7 +707,7 @@ static NTSTATUS x11drv_init( void *arg )
XkbUseExtension( gdi_display, NULL, NULL ); XkbUseExtension( gdi_display, NULL, NULL );
X11DRV_InitKeyboard( gdi_display ); X11DRV_InitKeyboard( gdi_display );
if (use_xim) use_xim = X11DRV_InitXIM( input_style ); if (use_xim) use_xim = xim_init( input_style );
init_user_driver(); init_user_driver();
X11DRV_DisplayDevices_Init(FALSE); X11DRV_DisplayDevices_Init(FALSE);
...@@ -791,7 +791,7 @@ struct x11drv_thread_data *x11drv_init_thread_data(void) ...@@ -791,7 +791,7 @@ struct x11drv_thread_data *x11drv_init_thread_data(void)
set_queue_display_fd( data->display ); set_queue_display_fd( data->display );
NtUserGetThreadInfo()->driver_data = (UINT_PTR)data; NtUserGetThreadInfo()->driver_data = (UINT_PTR)data;
if (use_xim) X11DRV_SetupXIM(); if (use_xim) xim_thread_attach( data );
return data; return data;
} }
......
...@@ -288,13 +288,10 @@ NTSTATUS x11drv_xim_preedit_state( void *arg ) ...@@ -288,13 +288,10 @@ NTSTATUS x11drv_xim_preedit_state( void *arg )
return 0; return 0;
} }
/*********************************************************************** /***********************************************************************
* X11DRV_InitXIM * xim_init
*
* Process-wide XIM initialization.
*/ */
BOOL X11DRV_InitXIM( const WCHAR *input_style ) BOOL xim_init( const WCHAR *input_style )
{ {
static const WCHAR offthespotW[] = {'o','f','f','t','h','e','s','p','o','t',0}; static const WCHAR offthespotW[] = {'o','f','f','t','h','e','s','p','o','t',0};
static const WCHAR overthespotW[] = {'o','v','e','r','t','h','e','s','p','o','t',0}; static const WCHAR overthespotW[] = {'o','v','e','r','t','h','e','s','p','o','t',0};
...@@ -416,26 +413,6 @@ static BOOL open_xim( Display *display ) ...@@ -416,26 +413,6 @@ static BOOL open_xim( Display *display )
thread_data->xim = xim; thread_data->xim = xim;
if ((ximStyle & (XIMPreeditNothing | XIMPreeditNone)) == 0 ||
(ximStyle & (XIMStatusNothing | XIMStatusNone)) == 0)
{
char **list;
int count;
thread_data->font_set = XCreateFontSet(display, "fixed",
&list, &count, NULL);
TRACE("ximFontSet = %p\n", thread_data->font_set);
TRACE("list = %p, count = %d\n", list, count);
if (list != NULL)
{
int i;
for (i = 0; i < count; ++i)
TRACE("list[%d] = %s\n", i, list[i]);
XFreeStringList(list);
}
}
else
thread_data->font_set = NULL;
x11drv_client_call( client_ime_update_association, 0 ); x11drv_client_call( client_ime_update_association, 0 );
return TRUE; return TRUE;
} }
...@@ -446,9 +423,16 @@ static void open_xim_callback( Display *display, XPointer ptr, XPointer data ) ...@@ -446,9 +423,16 @@ static void open_xim_callback( Display *display, XPointer ptr, XPointer data )
XUnregisterIMInstantiateCallback( display, NULL, NULL, NULL, open_xim_callback, NULL); XUnregisterIMInstantiateCallback( display, NULL, NULL, NULL, open_xim_callback, NULL);
} }
void X11DRV_SetupXIM(void) void xim_thread_attach( struct x11drv_thread_data *data )
{ {
Display *display = thread_display(); Display *display = data->display;
int i, count;
char **list;
data->font_set = XCreateFontSet( display, "fixed", &list, &count, NULL );
TRACE( "created XFontSet %p, list %p, count %d\n", data->font_set, list, count );
for (i = 0; list && i < count; ++i) TRACE( " %d: %s\n", i, list[i] );
if (list) XFreeStringList( list );
if (!open_xim( display )) if (!open_xim( display ))
XRegisterIMInstantiateCallback( display, NULL, NULL, NULL, open_xim_callback, NULL ); XRegisterIMInstantiateCallback( display, NULL, NULL, NULL, open_xim_callback, NULL );
......
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