aboutsummaryrefslogtreecommitdiff
path: root/libX11/modules/im/ximcp/imLcLkup.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-02-22 13:55:31 +0000
committermarha <marha@users.sourceforge.net>2011-02-22 13:55:31 +0000
commit9273afeeb4499a0493f120b7525e17b6ae51113e (patch)
tree404ae2c5f693be6ea2c0d6eb55e2c68b9d177e00 /libX11/modules/im/ximcp/imLcLkup.c
parent248adea786d4a5a9d2c71679722eda734d4e7be7 (diff)
downloadvcxsrv-9273afeeb4499a0493f120b7525e17b6ae51113e.tar.gz
vcxsrv-9273afeeb4499a0493f120b7525e17b6ae51113e.tar.bz2
vcxsrv-9273afeeb4499a0493f120b7525e17b6ae51113e.zip
xserver libX11 pixman mesa git update 22 Feb 2011
Diffstat (limited to 'libX11/modules/im/ximcp/imLcLkup.c')
-rw-r--r--libX11/modules/im/ximcp/imLcLkup.c30
1 files changed, 20 insertions, 10 deletions
diff --git a/libX11/modules/im/ximcp/imLcLkup.c b/libX11/modules/im/ximcp/imLcLkup.c
index 4891176cc..8e4111a6a 100644
--- a/libX11/modules/im/ximcp/imLcLkup.c
+++ b/libX11/modules/im/ximcp/imLcLkup.c
@@ -63,20 +63,25 @@ _XimLocalMbLookupString(XIC xic, XKeyEvent *ev, char *buffer, int bytes,
unsigned char pattern = ic->private.local.brl_committed;
char mb[XLC_PUBLIC(ic->core.im->core.lcd, mb_cur_max)];
ret = _Xlcwctomb(ic->core.im->core.lcd, mb, BRL_UC_ROW | pattern);
- if(ret < 0) {
- if(status) *status = XLookupNone;
- return(0);
- }
if(ret > bytes) {
if(status) *status = XBufferOverflow;
return(ret);
}
- if(keysym) {
- *keysym = XK_braille_blank | pattern;
- if(status) *status = XLookupBoth;
- } else
- if(status) *status = XLookupChars;
- memcpy(buffer, mb, ret);
+ if(keysym) *keysym = XK_braille_blank | pattern;
+ if(ret > 0) {
+ if (keysym) {
+ if(status) *status = XLookupBoth;
+ } else {
+ if(status) *status = XLookupChars;
+ }
+ memcpy(buffer, mb, ret);
+ } else {
+ if(keysym) {
+ if(status) *status = XLookupKeySym;
+ } else {
+ if(status) *status = XLookupNone;
+ }
+ }
} else { /* Composed Event */
ret = strlen(&mb[b[ic->private.local.composed].mb]);
if(ret > bytes) {
@@ -217,6 +222,11 @@ _XimLocalUtf8LookupString(XIC xic, XKeyEvent *ev, char *buffer, int bytes,
buffer[0] = 0xe0 | ((BRL_UC_ROW >> 12) & 0x0f);
buffer[1] = 0x80 | ((BRL_UC_ROW >> 8) & 0x30) | (pattern >> 6);
buffer[2] = 0x80 | (pattern & 0x3f);
+ if(keysym) {
+ *keysym = XK_braille_blank | pattern;
+ if(status) *status = XLookupBoth;
+ } else
+ if(status) *status = XLookupChars;
} else { /* Composed Event */
ret = strlen(&utf8[b[ic->private.local.composed].utf8]);
if(ret > bytes) {