242 |
break; \ |
break; \ |
243 |
case 1: /* Filled */ \ |
case 1: /* Filled */ \ |
244 |
XFillArc(g_display, g_wnd, g_gc, x, y, cx, cy, 0, 360*64); \ |
XFillArc(g_display, g_wnd, g_gc, x, y, cx, cy, 0, 360*64); \ |
245 |
ON_ALL_SEAMLESS_WINDOWS(XCopyArea, (g_display, g_ownbackstore ? g_backstore : g_wnd, sw->wnd, g_gc, \ |
ON_ALL_SEAMLESS_WINDOWS(XFillArc, (g_display, sw->wnd, g_gc, x-sw->xoffset, y-sw->yoffset, cx, cy, 0, 360*64)); \ |
|
x, y, cx, cy, x-sw->xoffset, y-sw->yoffset)); \ |
|
246 |
if (g_ownbackstore) \ |
if (g_ownbackstore) \ |
247 |
XFillArc(g_display, g_backstore, g_gc, x, y, cx, cy, 0, 360*64); \ |
XFillArc(g_display, g_backstore, g_gc, x, y, cx, cy, 0, 360*64); \ |
248 |
break; \ |
break; \ |
1313 |
} |
} |
1314 |
|
|
1315 |
static BOOL |
static BOOL |
1316 |
select_visual() |
select_visual(int screen_num) |
1317 |
{ |
{ |
1318 |
XPixmapFormatValues *pfm; |
XPixmapFormatValues *pfm; |
1319 |
int pixmap_formats_count, visuals_count; |
int pixmap_formats_count, visuals_count; |
1339 |
|
|
1340 |
/* Search for best TrueColor visual */ |
/* Search for best TrueColor visual */ |
1341 |
template.class = TrueColor; |
template.class = TrueColor; |
1342 |
vmatches = XGetVisualInfo(g_display, VisualClassMask, &template, &visuals_count); |
template.screen = screen_num; |
1343 |
|
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; |
1547 |
g_screen = ScreenOfDisplay(g_display, screen_num); |
g_screen = ScreenOfDisplay(g_display, screen_num); |
1548 |
g_depth = DefaultDepthOfScreen(g_screen); |
g_depth = DefaultDepthOfScreen(g_screen); |
1549 |
|
|
1550 |
if (!select_visual()) |
if (!select_visual(screen_num)) |
1551 |
return False; |
return False; |
1552 |
|
|
1553 |
if (g_no_translate_image) |
if (g_no_translate_image) |
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 |
|
|