Hack to disable XInitThreads when an XIM is used.
http://source.winehq.org/git/wine.git/? ... e24e345933
代码: 全选
--- a/dlls/winex11.drv/x11drv_main.c
+++ b/dlls/winex11.drv/x11drv_main.c
@@ -378,6 +378,7 @@ static BOOL process_attach(void)
{
Display *display;
XVisualInfo *desktop_vi = NULL;
+ const char *env;
setup_options();
@@ -385,7 +386,8 @@ static BOOL process_attach(void)
/* Open display */
- if (!XInitThreads()) ERR( "XInitThreads failed, trouble ahead\n" );
+ if (!(env = getenv("XMODIFIERS")) || !*env) /* try to avoid the Xlib XIM locking bug */
+ if (!XInitThreads()) ERR( "XInitThreads failed, trouble ahead\n" );
if (!(display = XOpenDisplay( NULL ))) return FALSE;