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