From 5c181a1e5fb19aa5dea8b16a834c435803b9a348 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20=C3=85strand?= Date: Sat, 27 Jul 2002 23:09:32 +0000 Subject: [PATCH] Add support for enabling/disabling local compose handling. Compose support is now disabled per default git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@69 423420c4-83ab-492f-b58f-81f9feb106b5 --- keymaps/README | 10 ++++++++++ xkeymap.c | 9 +++++++++ xwin.c | 13 ++++++++----- 3 files changed, 27 insertions(+), 5 deletions(-) diff --git a/keymaps/README b/keymaps/README index 3607f1b..418397f 100644 --- a/keymaps/README +++ b/keymaps/README @@ -42,6 +42,16 @@ X 2d shift If flags include "localstate", the modifier to send will be determined by the local modifier state. + +4) enable_compose + +If any line starts with the keyword "enable_compose", rdesktop will +enable local Compose/Multi_key handling. Enabling this will often make +it impossible to compose characters with dead keys (on the remote +side). This is because when local compose support is enabled, dead +keys will not be sent to the remote side. + + Suggested X11 keysym mapping on PCs =================================== Unfortunately, there is no standard for which keysyms a given key diff --git a/xkeymap.c b/xkeymap.c index 83e8544..0363b3b 100644 --- a/xkeymap.c +++ b/xkeymap.c @@ -35,6 +35,7 @@ extern Display *display; extern char keymapname[16]; extern int keylayout; +extern BOOL enable_compose; static key_translation keymap[KEYMAP_SIZE]; static unsigned int min_keycode; @@ -120,6 +121,14 @@ xkeymap_read(char *mapname) continue; } + /* compose */ + if (strncmp(line, "enable_compose", 15) == 0) + { + DEBUG_KBD("Enabling compose handling\n"); + enable_compose = True; + continue; + } + /* Comment */ if (line[0] == '#') { diff --git a/xwin.c b/xwin.c index 6751bdc..b2541d5 100644 --- a/xwin.c +++ b/xwin.c @@ -62,6 +62,9 @@ static uint32 *colmap; static XIM IM = NULL; static XIC IC = NULL; +/* Compose support */ +BOOL enable_compose = False; + #define TRANSLATE(col) ( owncolmap ? col : translate_colour(colmap[col]) ) #define SET_FOREGROUND(col) XSetForeground(display, gc, TRANSLATE(col)); #define SET_BACKGROUND(col) XSetBackground(display, gc, TRANSLATE(col)); @@ -185,7 +188,7 @@ translate_colour(uint32 colour) static unsigned long init_inputmethod(void) { - unsigned long filtered_events; + unsigned long filtered_events = 0; IM = XOpenIM(display, NULL, NULL, NULL); if (IM == NULL) @@ -248,7 +251,6 @@ ui_create_window(char *title) Screen *screen; uint16 test; int i; - unsigned long filtered_events; display = XOpenDisplay(NULL); @@ -352,9 +354,10 @@ ui_create_window(char *title) if (ownbackstore) input_mask |= ExposureMask; - filtered_events = init_inputmethod(); + if (enable_compose) + input_mask |= init_inputmethod(); - XSelectInput(display, wnd, input_mask | filtered_events); + XSelectInput(display, wnd, input_mask); gc = XCreateGC(display, wnd, 0, NULL); @@ -405,7 +408,7 @@ xwin_process_events() while (XCheckMaskEvent(display, ~0, &xevent)) { - if (XFilterEvent(&xevent, None) == True) + if (enable_compose && (XFilterEvent(&xevent, None) == True)) { DEBUG_KBD("Filtering event\n"); continue;