--- sourceforge.net/trunk/rdesktop/xwin.c 2004/04/26 23:14:07 680 +++ sourceforge.net/trunk/rdesktop/xwin.c 2004/05/06 08:17:47 691 @@ -45,6 +45,7 @@ Window g_wnd; extern uint32 g_embed_wnd; BOOL g_enable_compose = False; +BOOL g_Unobscured; /* used for screenblt */ static GC g_gc = NULL; static Visual *g_visual; static int g_depth; @@ -251,7 +252,8 @@ uint16 value; if (g_arch_match) - REPEAT(*(((uint16*)out)++) = g_colmap[*(data++)];) + REPEAT(*(((uint16 *) out)++) = g_colmap[*(data++)]; + ) else if (g_xserver_be) { while (out < end) @@ -306,7 +308,8 @@ uint32 value; if (g_arch_match) - REPEAT(*(((uint32*)out)++) = g_colmap[*(data++)];) + REPEAT(*(((uint32 *) out)++) = g_colmap[*(data++)]; + ) else if (g_xserver_be) { while (out < end) @@ -1005,6 +1008,7 @@ XMaskEvent(g_display, VisibilityChangeMask, &xevent); } while (xevent.type != VisibilityNotify); + g_Unobscured = xevent.xvisibility.state == VisibilityUnobscured; g_focused = False; g_mouse_in_wnd = False; @@ -1103,6 +1107,9 @@ switch (xevent.type) { + case VisibilityNotify: + g_Unobscured = xevent.xvisibility.state == VisibilityUnobscured; + break; case ClientMessage: /* the window manager told us to quit */ if ((xevent.xclient.message_type == g_protocol_atom) @@ -1849,8 +1856,18 @@ SET_FUNCTION(opcode); if (g_ownbackstore) { - XCopyArea(g_display, g_backstore, g_wnd, g_gc, srcx, srcy, cx, cy, x, y); - XCopyArea(g_display, g_backstore, g_backstore, g_gc, srcx, srcy, cx, cy, x, y); + if (g_Unobscured) + { + XCopyArea(g_display, g_wnd, g_wnd, g_gc, srcx, srcy, cx, cy, x, y); + XCopyArea(g_display, g_backstore, g_backstore, g_gc, srcx, srcy, cx, cy, x, + y); + } + else + { + XCopyArea(g_display, g_backstore, g_wnd, g_gc, srcx, srcy, cx, cy, x, y); + XCopyArea(g_display, g_backstore, g_backstore, g_gc, srcx, srcy, cx, cy, x, + y); + } } else {