--- sourceforge.net/trunk/rdesktop/xwin.c 2002/09/15 11:39:16 157 +++ sourceforge.net/trunk/rdesktop/xwin.c 2002/09/17 16:55:43 182 @@ -351,6 +351,9 @@ height = HeightOfScreen(screen); } + /* make sure width is a multiple of 4 */ + width = (width + 3) & ~3; + xkeymap_init(); return True; } @@ -432,19 +435,6 @@ display = NULL; } -static void -xwin_reset_keys() -{ - /* reset keys */ - uint32 ev_time; - ev_time = time(NULL); - rdp_send_scancode(ev_time, RDP_KEYRELEASE, SCANCODE_CHAR_LCTRL); - rdp_send_scancode(ev_time, RDP_KEYRELEASE, SCANCODE_CHAR_LALT); - rdp_send_scancode(ev_time, RDP_KEYRELEASE, SCANCODE_CHAR_LSHIFT); - rdp_send_scancode(ev_time, RDP_KEYRELEASE, SCANCODE_CHAR_RCTRL); - rdp_send_scancode(ev_time, RDP_KEYRELEASE, SCANCODE_CHAR_RALT); - rdp_send_scancode(ev_time, RDP_KEYRELEASE, SCANCODE_CHAR_RSHIFT); -} void xwin_toggle_fullscreen() @@ -454,7 +444,7 @@ int newwidth, newheight; fullscreen = !fullscreen; - newwidth = fullscreen ? WidthOfScreen(screen) : width; + newwidth = fullscreen ? WidthOfScreen(screen) : width; newheight = fullscreen ? HeightOfScreen(screen) : height; XUnmapWindow(display, wnd); @@ -509,13 +499,13 @@ else { /* Plain old XLookupString */ - DEBUG_KBD(("No input context, using XLookupString\n")); + DEBUG_KBD(("\nNo input context, using XLookupString\n")); XLookupString((XKeyEvent *) & xevent, str, sizeof(str), &keysym, NULL); } ksname = get_ksname(keysym); - DEBUG_KBD(("\nKeyPress for (keysym 0x%lx, %s)\n", keysym, ksname)); + DEBUG_KBD(("KeyPress for (keysym 0x%lx, %s)\n", keysym, ksname)); if (handle_special_keys(keysym, ev_time, True)) break; @@ -568,22 +558,21 @@ MOUSE_FLAG_MOVE, xevent.xmotion.x, xevent.xmotion.y); break; - case FocusIn: - /* fall through */ case EnterNotify: if (grab_keyboard) XGrabKeyboard(display, wnd, True, GrabModeAsync, GrabModeAsync, CurrentTime); break; - case FocusOut: - xwin_reset_keys(); - /* fall through */ case LeaveNotify: if (grab_keyboard) XUngrabKeyboard(display, CurrentTime); break; + case FocusIn: + reset_modifier_keys(); + break; + case Expose: XCopyArea(display, backstore, wnd, gc, xevent.xexpose.x, xevent.xexpose.y,