mirror of
https://github.com/RTimothyEdwards/magic.git
synced 2026-10-06 09:53:00 +02:00
Corrected an error that prevents the compile option
"--enable-cairo-offscreen" from working. Because the option does not run the full Cario initialization, the grTCairoVisualInfo is not set, and the first attempt to create a Cairo surface fails with a segfault.
This commit is contained in:
@@ -363,6 +363,25 @@ int llx, lly, width, height;
|
||||
/* surface and context, so we need to make them. */
|
||||
|
||||
if (tcairodata == NULL) {
|
||||
|
||||
/* For OpenGL using Cairo for off-screen rendering, */
|
||||
/* grTCairoVisualInfo may be NULL and need to be set. */
|
||||
if (grTCairoVisualInfo == NULL)
|
||||
{
|
||||
XVisualInfo grtemplate;
|
||||
int gritems;
|
||||
grtemplate.screen = grXscrn;
|
||||
grtemplate.depth = 0;
|
||||
grTCairoVisualInfo = XGetVisualInfo(grXdpy, VisualScreenMask,
|
||||
&grtemplate, &gritems);
|
||||
|
||||
if (!grTCairoVisualInfo)
|
||||
{
|
||||
TxError("No suitable visual!\n");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
tcairodata = (TCairoData *)mallocMagic(sizeof(TCairoData));
|
||||
tcairodata->surface = cairo_xlib_surface_create(grXdpy,
|
||||
tcairoCurrent.windowid, grTCairoVisualInfo->visual,
|
||||
|
||||
Reference in New Issue
Block a user