If a seat gets opened with a renderer type of AUTO, and the renderer
fails to open, then it's okay and expected to proceed without a
renderer (and just use the terminal). The code attempted to do this
but failed to nullify the seat->renderer object, so it ended up
going down the renderer-active code path.
This commit fixes that.
renderer = ply_renderer_new (renderer_type, device, seat->terminal);
- if (!ply_renderer_open (renderer) && renderer_type != PLY_RENDERER_TYPE_AUTO)
+ if (!ply_renderer_open (renderer))
{
ply_trace ("could not open renderer for %s", device);
ply_renderer_free (renderer);
- return false;
- }
- seat->renderer = renderer;
- seat->renderer_active = true;
+ seat->renderer = NULL;
+ seat->renderer_active = false;
+
+ if (renderer_type != PLY_RENDERER_TYPE_AUTO)
+ return false;
+ }
+ else
+ {
+ seat->renderer = renderer;
+ seat->renderer_active = true;
+ }
}
if (seat->renderer != NULL)