[PATCH 1/2] Improved fix for mono bug #692206
authorEberhard Beilharz <eb1@sil.org>
Wed, 29 Jun 2011 06:23:21 +0000 (08:23 +0200)
committerThomas Goldstein <stifu@free.fr>
Wed, 29 Jun 2011 06:32:05 +0000 (08:32 +0200)
commitfa87d068880e611ae52f9383bdde80188434581c
treeb6ce53e32fc18f0028707d9dc3ba5539c079b142
parent01767e670ed2f0889fd88c0b8c5b6b73d9b99746
[PATCH 1/2] Improved fix for mono bug #692206

In contrast to Xutf8LookupString, XLookupString returns the number
of characters stored in the buffer instead of a status. If the buffer
is too small the output is truncated, but we don't know it. However, it
seems pretty unlikely that a buffer of 24 chars shouldn't be enough for a
single key press, so I simplified the code a little bit.
Also, XLookupString converts the keySym to an ISO Latin-1
character so that there is no need to do an explicit conversion.

Add variable to store Ansi encoding so that we have to get it only once.

Fix a few problems encountered debugging this problem.
mcs/class/Managed.Windows.Forms/System.Windows.Forms/X11Keyboard.cs