aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/lib/X11/imLcLkup.c
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2011-02-21 15:56:54 +0100
committerUlrich Sibiller <uli42@gmx.de>2016-10-19 21:40:26 +0200
commit93a4f5c4758f68717c4e8fa8cb346719b265319c (patch)
treef5269ab6daf0adfcf10e7b1007c079b0b5d4c638 /nx-X11/lib/X11/imLcLkup.c
parent2cca621e3996246d46a43bb6a4a6df335bf33466 (diff)
downloadnx-libs-93a4f5c4758f68717c4e8fa8cb346719b265319c.tar.gz
nx-libs-93a4f5c4758f68717c4e8fa8cb346719b265319c.tar.bz2
nx-libs-93a4f5c4758f68717c4e8fa8cb346719b265319c.zip
Fix status reporting for braille patterns
_XimLocalMbLookupString can return a braille keysym even if _Xlcwctomb can't convert to the current MB charset. _XimLocalUtf8LookupString needs to set the braille keysym and status too. Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org> Backported-to-NX-by: Ulrich Sibiller <uli42@gmx.de>
Diffstat (limited to 'nx-X11/lib/X11/imLcLkup.c')
-rw-r--r--nx-X11/lib/X11/imLcLkup.c26
1 files changed, 20 insertions, 6 deletions
diff --git a/nx-X11/lib/X11/imLcLkup.c b/nx-X11/lib/X11/imLcLkup.c
index fa65ed077..9449b9f43 100644
--- a/nx-X11/lib/X11/imLcLkup.c
+++ b/nx-X11/lib/X11/imLcLkup.c
@@ -67,12 +67,21 @@ _XimLocalMbLookupString(XIC xic, XKeyEvent *ev, char *buffer, int 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) {
@@ -213,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) {