… | |
… | |
260 | depth = DefaultDepthOfScreen (screen); |
260 | depth = DefaultDepthOfScreen (screen); |
261 | visual = DefaultVisualOfScreen (screen); |
261 | visual = DefaultVisualOfScreen (screen); |
262 | cmap = DefaultColormapOfScreen (screen); |
262 | cmap = DefaultColormapOfScreen (screen); |
263 | } |
263 | } |
264 | |
264 | |
|
|
265 | #if ENABLE_FRILLS |
|
|
266 | |
265 | void |
267 | void |
266 | rxvt_screen::select_visual (int bitdepth) |
268 | rxvt_screen::select_visual (int id) |
267 | { |
269 | { |
268 | #if XFT |
|
|
269 | XVisualInfo vinfo; |
270 | XVisualInfo vinfo; |
|
|
271 | vinfo.visualid = id; |
|
|
272 | int n; |
|
|
273 | |
|
|
274 | if (XVisualInfo *vi = XGetVisualInfo (dpy, VisualIDMask, &vinfo, &n)) |
|
|
275 | { |
|
|
276 | depth = vi->depth; |
|
|
277 | visual = vi->visual; |
|
|
278 | |
|
|
279 | XFree (vi); |
|
|
280 | |
|
|
281 | cmap = XCreateColormap (dpy, display->root, visual, AllocNone); |
|
|
282 | } |
|
|
283 | else |
|
|
284 | rxvt_warn ("cannot requested visual id 0x%02x, using default visual.\n", id); |
|
|
285 | } |
|
|
286 | |
|
|
287 | void |
|
|
288 | rxvt_screen::select_depth (int bitdepth) |
|
|
289 | { |
|
|
290 | XVisualInfo vinfo; |
270 | |
291 | |
271 | if (XMatchVisualInfo (dpy, display->screen, bitdepth, TrueColor, &vinfo)) |
292 | if (XMatchVisualInfo (dpy, display->screen, bitdepth, TrueColor, &vinfo)) |
272 | { |
|
|
273 | depth = bitdepth; |
|
|
274 | visual = vinfo.visual; |
293 | select_visual (vinfo.visualid); |
275 | cmap = XCreateColormap (dpy, display->root, visual, AllocNone); |
294 | else |
276 | } |
295 | rxvt_warn ("no visual found for requested depth %d, using default visual.\n", bitdepth); |
277 | #endif |
|
|
278 | } |
296 | } |
|
|
297 | |
|
|
298 | #endif |
279 | |
299 | |
280 | void |
300 | void |
281 | rxvt_screen::clear () |
301 | rxvt_screen::clear () |
282 | { |
302 | { |
283 | #if XFT |
303 | #if XFT |
… | |
… | |
470 | |
490 | |
471 | flags = 0; |
491 | flags = 0; |
472 | #if XRENDER |
492 | #if XRENDER |
473 | int major, minor; |
493 | int major, minor; |
474 | if (XRenderQueryVersion (dpy, &major, &minor)) |
494 | if (XRenderQueryVersion (dpy, &major, &minor)) |
475 | { |
|
|
476 | flags |= DISPLAY_HAS_RENDER; |
|
|
477 | |
|
|
478 | if (major > 0 || (major == 0 && minor >= 10)) |
495 | if (major > 0 || (major == 0 && minor >= 10)) |
|
|
496 | { |
479 | flags |= DISPLAY_HAS_RENDER_10; |
497 | flags |= DISPLAY_HAS_RENDER; |
480 | |
498 | |
|
|
499 | #if 0 |
481 | if (major > 0 || (major == 0 && minor >= 11)) |
500 | if (major > 0 || (major == 0 && minor >= 11)) |
482 | flags |= DISPLAY_HAS_RENDER_MUL; |
501 | flags |= DISPLAY_HAS_RENDER_MUL; |
|
|
502 | #endif |
483 | |
503 | |
484 | XFilters *filters = XRenderQueryFilters (dpy, root); |
504 | if (XFilters *filters = XRenderQueryFilters (dpy, root)) |
485 | if (filters) |
|
|
486 | { |
505 | { |
487 | for (int i = 0; i < filters->nfilter; i++) |
506 | for (int i = 0; i < filters->nfilter; i++) |
488 | if (!strcmp (filters->filter[i], FilterConvolution)) |
507 | if (!strcmp (filters->filter [i], FilterConvolution)) |
489 | flags |= DISPLAY_HAS_RENDER_CONV; |
508 | flags |= DISPLAY_HAS_RENDER_CONV; |
490 | |
509 | |
491 | XFree (filters); |
510 | XFree (filters); |
492 | } |
511 | } |
493 | } |
512 | } |
494 | #endif |
513 | #endif |
495 | |
514 | |
496 | int fd = XConnectionNumber (dpy); |
515 | int fd = XConnectionNumber (dpy); |
497 | |
516 | |
498 | // try to detect whether we have a local connection. |
517 | // try to detect whether we have a local connection. |