winex11.drv: Prevent XCreateIC from returning NULL when input style isn't "root". (try 3)

Muneyuki Noguchi nogu.dev at gmail.com
Mon Oct 13 02:50:01 CDT 2008


In the current implementation of Wine, XCreateIC() in
X11DRV_CreateIC() returns NULL with SCIM-Anthy when input style is set
to "over the spot" even in CJK environment because a font set isn't
given to XCreateIC(). So Wine users can't turn on the input method in
this settings. This patch allocates one font set per input context
(XIC) and gives it to XCreateIC(). With this patch, XCreateFontSet()
is called in X11DRV_CreateIC(), where XCreateIC() is called, and
XFreeFontSet() is called in destroy_whole_window(), where XDestroyIC()
is called:

XCreateIC - XDestroyIC
XCreateFontSet - XFreeFontSet

Before Wine 0.9.40, a font set was given to XCreateIC() but was
removed by Nigel Liang's patch[1] to fix bug 5309 (he overlooked the
regression).[2] But in this patch, "fixed" is given to the second
argument of XCreateFontSet() instead of "*", and X11DRV_CreateIC() in
Wine 1.1.6 is called less frequently than that in Wine 0.9.40. I think
this patch won't introduce performance issues.

You can reproduce the regression by setting locale ($LANG) to one of
CJK, adding the following two lines to ~/.wine/user.reg:

[Software\\Wine\\X11 Driver]
"InputStyle"="overthespot"

and running a text editor.

1. http://www.winehq.org/pipermail/wine-patches/2007-June/040654.html
2. http://bugs.winehq.org/show_bug.cgi?id=5309  (Wine performance lost
on some CJK environment)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-winex11.drv-Prevent-XCreateIC-from-returning-NULL-w.patch
Type: text/x-patch
Size: 3608 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20081013/87d827b2/attachment.bin 


More information about the wine-patches mailing list