--- sourceforge.net/trunk/rdesktop/xwin.c 2002/07/27 22:35:38 69 +++ sourceforge.net/trunk/rdesktop/xwin.c 2002/07/29 19:21:51 73 @@ -62,6 +62,9 @@ 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 @@ 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 @@ Screen *screen; uint16 test; int i; - unsigned long filtered_events; display = XOpenDisplay(NULL); @@ -352,9 +354,10 @@ 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 @@ while (XCheckMaskEvent(display, ~0, &xevent)) { - if (XFilterEvent(&xevent, None) == True) + if (enable_compose && (XFilterEvent(&xevent, None) == True)) { DEBUG_KBD("Filtering event\n"); continue; @@ -586,8 +589,8 @@ tdata = (owncolmap ? data : translate_image(width, height, data)); bitmap = XCreatePixmap(display, wnd, width, height, depth); - image = XCreateImage(display, visual, depth, ZPixmap, 0, tdata, width, - height, 8, 0); + image = XCreateImage(display, visual, depth, ZPixmap, 0, (char *)tdata, + width, height, 8, 0); XPutImage(display, bitmap, gc, image, 0, 0, 0, 0, width, height); @@ -605,8 +608,8 @@ uint8 *tdata; tdata = (owncolmap ? data : translate_image(width, height, data)); - image = XCreateImage(display, visual, depth, ZPixmap, 0, tdata, width, - height, 8, 0); + image = XCreateImage(display, visual, depth, ZPixmap, 0, (char *)tdata, + width, height, 8, 0); if (ownbackstore) { @@ -642,8 +645,8 @@ bitmap = XCreatePixmap(display, wnd, width, height, 1); gc = XCreateGC(display, bitmap, 0, NULL); - image = XCreateImage(display, visual, 1, ZPixmap, 0, data, width, - height, 8, scanline); + image = XCreateImage(display, visual, 1, ZPixmap, 0, (char *)data, + width, height, 8, scanline); image->byte_order = MSBFirst; image->bitmap_bit_order = MSBFirst; XInitImage(image); @@ -1013,9 +1016,10 @@ if ((xyoffset & 0x80))\ {\ if (flags & TEXT2_VERTICAL) \ - y += ttext[++idx] | (ttext[++idx] << 8);\ + y += ttext[idx+1] | (ttext[idx+2] << 8);\ else\ - x += ttext[++idx] | (ttext[++idx] << 8);\ + x += ttext[idx+1] | (ttext[idx+2] << 8);\ + idx += 2;\ }\ else\ {\ @@ -1153,8 +1157,8 @@ if (data == NULL) return; - image = XCreateImage(display, visual, depth, ZPixmap, 0, data, cx, cy, - BitmapPad(display), cx * bpp / 8); + image = XCreateImage(display, visual, depth, ZPixmap, 0, (char *)data, + cx, cy, BitmapPad(display), cx * bpp / 8); if (ownbackstore) {