Wine keyboard driver+XKB. What am I to do?

Oleh R. Nykyforchyn nick at
Wed May 16 14:45:15 CDT 2007

I need an advice on what to do with some piece of code that I have written for
about 3 years. I started to make changes in Wine keyboard driver because I was
not able to use MS Office under it on my Linux box (3 or 4 XKB groups, 2 overlay
groups used, English, Russian, Ukrainian, Belarusian, German and Polish
layouts). First I submitted a patch that adds koi8-u encoding to Wine, and it was
happily introduced. But my changes to X11DRV (now winex11) keyboard driver were
large and I understand Wine people who didn't want to risk.  Meanwhile I
continued to polish my implementation to correct bugs and improve performance.
I am heavily indebted to people that tested my patches, wrote me about problems
with them and suggested possible solutions. I thank to L.Rahyen that supported
me in my efforts.

Now patched keyboard driver allows user to:

1) have up to 4 XKB groups working (current code uses 1 or 2);
2) detect and use XKB overlays to put 2 or 3 close layouts (e.g. Russian,
Ukrainian and Belarusian) into one XKB group;
3) freely combine available XKB layouts in any order, e.g. "en,ru,fr";
4) list all layouts available at the system, and implement
5) notify an application (e.g. MS Word) about change of layout, and make
GetKeyboardLayout() work really, not just return LCID for current locale
of Unix box;
6) input characters that do not fit into current Unix locale, e.g. German and
French accented letters at a system with Cyrillic (not UTF) locale;
7) override any of detected layouts via registry, if user is not satisfied
with Wine driver choice.

In fact I made cosmetic changes to 3 files in winex11.drv directory: x11drv.h,
x11drv_main.c, event.c, but the fourth file keyboard.c was changed much more.
About half of functions in it were rewritten, and it now easier to read new
keyboard.c than diff output to understand the changes. 

I got very reasonable advice from L.Rahyen to broke the patch into smaller
parts. The problem is that I preserved the driver logic, but changed
data structures, so any such patch (even very small one) will touch hundreds if
lines across the whole file, probably introducing new bugs and being difficult
to read and understand. Also, there is no reason to change code by a patch
if we can benefit of it only after next patch.

Now I will be grateful to any help. How can such big changes be introduced in
Wine tree? I also attach a patch against wine-0.9.37 and copies of original and
changed files. Perhaps somebody, who is interested in multilingual keyboard input,
can test it and write me about results.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: wine-0.9.37.patch.gz
Type: application/octet-stream
Size: 26708 bytes
Desc: not available
Url :
-------------- next part --------------
A non-text attachment was scrubbed...
Name: winex11.drv.tgz
Type: application/octet-stream
Size: 85002 bytes
Desc: not available
Url :

More information about the wine-devel mailing list