--- sourceforge.net/trunk/rdesktop/xwin.c 2006/04/09 20:11:42 1223 +++ sourceforge.net/trunk/rdesktop/xwin.c 2006/12/07 15:23:45 1346 @@ -147,8 +147,6 @@ static BOOL g_using_full_workarea = False; #ifdef WITH_RDPSND -extern int g_dsp_fd; -extern BOOL g_dsp_busy; extern BOOL g_rdpsnd; #endif @@ -242,8 +240,7 @@ break; \ case 1: /* Filled */ \ XFillArc(g_display, g_wnd, g_gc, x, y, cx, cy, 0, 360*64); \ - ON_ALL_SEAMLESS_WINDOWS(XCopyArea, (g_display, g_ownbackstore ? g_backstore : g_wnd, sw->wnd, g_gc, \ - x, y, cx, cy, x-sw->xoffset, y-sw->yoffset)); \ + ON_ALL_SEAMLESS_WINDOWS(XFillArc, (g_display, sw->wnd, g_gc, x-sw->xoffset, y-sw->yoffset, cx, cy, 0, 360*64)); \ if (g_ownbackstore) \ XFillArc(g_display, g_backstore, g_gc, x, y, cx, cy, 0, 360*64); \ break; \ @@ -1314,7 +1311,7 @@ } static BOOL -select_visual() +select_visual(int screen_num) { XPixmapFormatValues *pfm; int pixmap_formats_count, visuals_count; @@ -1325,6 +1322,11 @@ red_weight = blue_weight = green_weight = 0; + if (g_server_depth == -1) + { + g_server_depth = DisplayPlanes(g_display, DefaultScreen(g_display)); + } + pfm = XListPixmapFormats(g_display, &pixmap_formats_count); if (pfm == NULL) { @@ -1335,7 +1337,10 @@ /* Search for best TrueColor visual */ template.class = TrueColor; - vmatches = XGetVisualInfo(g_display, VisualClassMask, &template, &visuals_count); + template.screen = screen_num; + vmatches = + XGetVisualInfo(g_display, VisualClassMask | VisualScreenMask, &template, + &visuals_count); g_visual = NULL; g_no_translate_image = False; g_compatible_arch = False; @@ -1540,7 +1545,7 @@ g_screen = ScreenOfDisplay(g_display, screen_num); g_depth = DefaultDepthOfScreen(g_screen); - if (!select_visual()) + if (!select_visual(screen_num)) return False; if (g_no_translate_image) @@ -2261,18 +2266,14 @@ FD_SET(rdp_socket, &rfds); FD_SET(g_x_socket, &rfds); -#ifdef WITH_RDPSND - /* FIXME: there should be an API for registering fds */ - if (g_dsp_busy) - { - FD_SET(g_dsp_fd, &wfds); - n = (g_dsp_fd > n) ? g_dsp_fd : n; - } -#endif /* default timeout */ tv.tv_sec = 60; tv.tv_usec = 0; +#ifdef WITH_RDPSND + rdpsnd_add_fds(&n, &rfds, &wfds, &tv); +#endif + /* add redirection handles */ rdpdr_add_fds(&n, &rfds, &wfds, &tv, &s_timeout); seamless_select_timeout(&tv); @@ -2285,21 +2286,25 @@ error("select: %s\n", strerror(errno)); case 0: +#ifdef WITH_RDPSND + rdpsnd_check_fds(&rfds, &wfds); +#endif + /* Abort serial read calls */ if (s_timeout) rdpdr_check_fds(&rfds, &wfds, (BOOL) True); continue; } +#ifdef WITH_RDPSND + rdpsnd_check_fds(&rfds, &wfds); +#endif + rdpdr_check_fds(&rfds, &wfds, (BOOL) False); if (FD_ISSET(rdp_socket, &rfds)) return 1; -#ifdef WITH_RDPSND - if (g_dsp_busy && FD_ISSET(g_dsp_fd, &wfds)) - wave_out_play(); -#endif } } @@ -3185,12 +3190,14 @@ if (g_ownbackstore) { image = XGetImage(g_display, g_backstore, x, y, cx, cy, AllPlanes, ZPixmap); + exit_if_null(image); } else { pix = XCreatePixmap(g_display, g_wnd, cx, cy, g_depth); XCopyArea(g_display, g_wnd, pix, g_gc, x, y, cx, cy, 0, 0); image = XGetImage(g_display, pix, 0, 0, cx, cy, AllPlanes, ZPixmap); + exit_if_null(image); XFreePixmap(g_display, pix); } @@ -3468,6 +3475,27 @@ } +void +ui_seamless_destroy_group(unsigned long id, unsigned long flags) +{ + seamless_window *sw, *sw_next; + + if (!g_seamless_active) + return; + + for (sw = g_seamless_windows; sw; sw = sw_next) + { + sw_next = sw->next; + + if (sw->group->id == id) + { + XDestroyWindow(g_display, sw->wnd); + sw_remove_window(sw); + } + } +} + + void ui_seamless_move_window(unsigned long id, int x, int y, int width, int height, unsigned long flags) {