Description: Allow loch to start without offscreen glXContext
 The call to glXCreateContext() always seems to fail.  in current sid.
 Upstream are investigating, but this is only used to render off-screen images,
 so it's better to let loch run than to give up.
Author: Olly Betts <olly@survex.com>
Bug: https://github.com/therion/therion/issues/158
Forwarded: no
Last-Update: 2019-12-06

--- a/loch/lxR2P.c
+++ b/loch/lxR2P.c
@@ -48,7 +48,9 @@
    r2pc->ctx = glXCreateContext( r2pc->dpy, r2pc->visinfo, NULL, False );
    if (!r2pc->ctx) {
       printf("Error: glXCreateContext failed\n");
+#if 0
       exit(-1);
+#endif
    }
    
 }
@@ -74,6 +76,10 @@
   if (c) {
     c->dpy = XOpenDisplay(NULL);
     R2Pmake_context(c);
+    if (!c->ctx) {
+      free(c);
+      return NULL;
+    }
     R2Pmake_pixmap(c, (unsigned int) width, (unsigned int) height);
   }
 	return c;
