1340 |
/* Search for best TrueColor visual */ |
/* Search for best TrueColor visual */ |
1341 |
template.class = TrueColor; |
template.class = TrueColor; |
1342 |
template.screen = screen_num; |
template.screen = screen_num; |
1343 |
vmatches = XGetVisualInfo(g_display, VisualClassMask | VisualScreenMask, &template, &visuals_count); |
vmatches = |
1344 |
|
XGetVisualInfo(g_display, VisualClassMask | VisualScreenMask, &template, |
1345 |
|
&visuals_count); |
1346 |
g_visual = NULL; |
g_visual = NULL; |
1347 |
g_no_translate_image = False; |
g_no_translate_image = False; |
1348 |
g_compatible_arch = False; |
g_compatible_arch = False; |
2268 |
FD_SET(rdp_socket, &rfds); |
FD_SET(rdp_socket, &rfds); |
2269 |
FD_SET(g_x_socket, &rfds); |
FD_SET(g_x_socket, &rfds); |
2270 |
|
|
|
#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 |
|
2271 |
/* default timeout */ |
/* default timeout */ |
2272 |
tv.tv_sec = 60; |
tv.tv_sec = 60; |
2273 |
tv.tv_usec = 0; |
tv.tv_usec = 0; |
2274 |
|
|
2275 |
|
#ifdef WITH_RDPSND |
2276 |
|
rdpsnd_add_fds(&n, &rfds, &wfds, &tv); |
2277 |
|
#endif |
2278 |
|
|
2279 |
/* add redirection handles */ |
/* add redirection handles */ |
2280 |
rdpdr_add_fds(&n, &rfds, &wfds, &tv, &s_timeout); |
rdpdr_add_fds(&n, &rfds, &wfds, &tv, &s_timeout); |
2281 |
seamless_select_timeout(&tv); |
seamless_select_timeout(&tv); |
2288 |
error("select: %s\n", strerror(errno)); |
error("select: %s\n", strerror(errno)); |
2289 |
|
|
2290 |
case 0: |
case 0: |
2291 |
|
#ifdef WITH_RDPSND |
2292 |
|
rdpsnd_check_fds(&rfds, &wfds); |
2293 |
|
#endif |
2294 |
|
|
2295 |
/* Abort serial read calls */ |
/* Abort serial read calls */ |
2296 |
if (s_timeout) |
if (s_timeout) |
2297 |
rdpdr_check_fds(&rfds, &wfds, (BOOL) True); |
rdpdr_check_fds(&rfds, &wfds, (BOOL) True); |
2298 |
continue; |
continue; |
2299 |
} |
} |
2300 |
|
|
2301 |
|
#ifdef WITH_RDPSND |
2302 |
|
rdpsnd_check_fds(&rfds, &wfds); |
2303 |
|
#endif |
2304 |
|
|
2305 |
rdpdr_check_fds(&rfds, &wfds, (BOOL) False); |
rdpdr_check_fds(&rfds, &wfds, (BOOL) False); |
2306 |
|
|
2307 |
if (FD_ISSET(rdp_socket, &rfds)) |
if (FD_ISSET(rdp_socket, &rfds)) |
2308 |
return 1; |
return 1; |
2309 |
|
|
|
#ifdef WITH_RDPSND |
|
|
if (g_dsp_busy && FD_ISSET(g_dsp_fd, &wfds)) |
|
|
wave_out_play(); |
|
|
#endif |
|
2310 |
} |
} |
2311 |
} |
} |
2312 |
|
|
3192 |
if (g_ownbackstore) |
if (g_ownbackstore) |
3193 |
{ |
{ |
3194 |
image = XGetImage(g_display, g_backstore, x, y, cx, cy, AllPlanes, ZPixmap); |
image = XGetImage(g_display, g_backstore, x, y, cx, cy, AllPlanes, ZPixmap); |
3195 |
|
exit_if_null(image); |
3196 |
} |
} |
3197 |
else |
else |
3198 |
{ |
{ |
3199 |
pix = XCreatePixmap(g_display, g_wnd, cx, cy, g_depth); |
pix = XCreatePixmap(g_display, g_wnd, cx, cy, g_depth); |
3200 |
XCopyArea(g_display, g_wnd, pix, g_gc, x, y, cx, cy, 0, 0); |
XCopyArea(g_display, g_wnd, pix, g_gc, x, y, cx, cy, 0, 0); |
3201 |
image = XGetImage(g_display, pix, 0, 0, cx, cy, AllPlanes, ZPixmap); |
image = XGetImage(g_display, pix, 0, 0, cx, cy, AllPlanes, ZPixmap); |
3202 |
|
exit_if_null(image); |
3203 |
XFreePixmap(g_display, pix); |
XFreePixmap(g_display, pix); |
3204 |
} |
} |
3205 |
|
|