Re: winex11.drv: Connect to XIM server dynamically. [take 2]
Kusanagi Kouichi <slash(a)ma.neweb.ne.jp> writes:
+ + if (data->xic) + return data->xic; + + xim = x11drv_thread_data()->xim; + if (!xim) + return NULL; + + return X11DRV_CreateIC(xim, data->whole_window, &data->xic);
You shouldn't store a pointer to an internal field of the win_data structure, that makes things hard to follow. You should store win_data or hwnd in the pointer field and dereference it in the callback.
@@ -651,7 +651,10 @@ struct x11drv_thread_data *x11drv_init_thread_data(void) if (TRACE_ON(synchronous)) XSynchronize( data->display, True ); wine_tsx11_unlock();
- if (use_xim && !(data->xim = X11DRV_SetupXIM( data->display, input_style ))) + data->xim = NULL; + if (use_xim && + !XRegisterIMInstantiateCallback(data->display, NULL, NULL, NULL, + X11DRV_SetupXIM, (XPointer)&data->xim))
The XRegisterIMInstantiateCallback should go in xim.c, the initialization code in x11drv_main.c shouldn't need to know about such implementation details. -- Alexandre Julliard julliard(a)winehq.org
participants (1)
-
Alexandre Julliard