--- sourceforge.net/trunk/rdesktop/xwin.c 2002/12/02 22:57:47 281 +++ sourceforge.net/trunk/rdesktop/xwin.c 2003/01/30 11:20:30 300 @@ -78,7 +78,7 @@ XFillRectangle(display, backstore, gc, x, y, cx, cy); \ } -#define FILL_RECTANGLE_FAST(x,y,cx,cy)\ +#define FILL_RECTANGLE_BACKSTORE(x,y,cx,cy)\ { \ XFillRectangle(display, ownbackstore ? backstore : wnd, gc, x, y, cx, cy); \ } @@ -128,7 +128,7 @@ hintsatom = XInternAtom(display, "_MOTIF_WM_HINTS", False); if (!hintsatom) { - error("Failed to get atom _MOTIF_WM_HINTS\n"); + warning("Failed to get atom _MOTIF_WM_HINTS: probably your window manager does not support MWM hints\n"); return; } @@ -300,10 +300,7 @@ { xcolmap = DefaultColormapOfScreen(screen); if (depth <= 8) - { - printf("You're using a screen depth of 8-bits or lower\n"); - printf("If you get scewed colours, try the -C switch\n"); - } + warning("Screen depth is 8 bits or lower: you may want to use -C for a private colourmap\n"); } gc = XCreateGC(display, RootWindowOfScreen(screen), 0, NULL); @@ -318,13 +315,16 @@ if ((width == 0) || (height == 0)) { /* Fetch geometry from _NET_WORKAREA */ - uint32 xpos, ypos; + uint32 x, y, cx, cy; - if (get_current_workarea(&xpos, &ypos, &width, &height) < 0) + if (get_current_workarea(&x, &y, &cx, &cy) == 0) { - error("Failed to get workarea.\n"); - error("Perhaps your window manager does not support EWMH?\n"); - error("Defaulting to geometry 800x600\n"); + width = cx; + height = cy; + } + else + { + warning("Failed to get workarea: probably your window manager does not support extended hints\n"); width = 800; height = 600; } @@ -607,6 +607,9 @@ break; case MotionNotify: + if (fullscreen && !focused) + XSetInputFocus(display, wnd, RevertToPointerRoot, + CurrentTime); rdp_send_input(time(NULL), RDP_INPUT_MOUSE, MOUSE_FLAG_MOVE, xevent.xmotion.x, xevent.xmotion.y); break; @@ -1189,7 +1192,7 @@ XSetStipple(display, gc, (Pixmap) glyph); XSetTSOrigin(display, gc, x, y); - FILL_RECTANGLE_FAST(x, y, cx, cy); + FILL_RECTANGLE_BACKSTORE(x, y, cx, cy); XSetFillStyle(display, gc, FillSolid); } @@ -1218,8 +1221,8 @@ }\ if (glyph != NULL)\ {\ - ui_draw_glyph (mixmode, x + (short) glyph->offset,\ - y + (short) glyph->baseline,\ + ui_draw_glyph (mixmode, x + glyph->offset,\ + y + glyph->baseline,\ glyph->width, glyph->height,\ glyph->pixmap, 0, 0, bgcolour, fgcolour);\ if (flags & TEXT2_IMPLICIT_X)\ @@ -1241,11 +1244,11 @@ if (boxcx > 1) { - FILL_RECTANGLE_FAST(boxx, boxy, boxcx, boxcy); + FILL_RECTANGLE_BACKSTORE(boxx, boxy, boxcx, boxcy); } else if (mixmode == MIX_OPAQUE) { - FILL_RECTANGLE_FAST(clipx, clipy, clipcx, clipcy); + FILL_RECTANGLE_BACKSTORE(clipx, clipy, clipcx, clipcy); } /* Paint text, character by character */ @@ -1279,17 +1282,17 @@ else x += text[i + 2]; } - if (i + 2 < length) - i += 3; - else - i += 2; - length -= i; - /* this will move pointer from start to first character after FE command */ - text = &(text[i]); - i = 0; for (j = 0; j < entry->size; j++) DO_GLYPH(((uint8 *) (entry->data)), j); } + if (i + 2 < length) + i += 3; + else + i += 2; + length -= i; + /* this will move pointer from start to first character after FE command */ + text = &(text[i]); + i = 0; break; default: