pugl: Prevent segfault when $DISPLAY is set to something that doesn't exist

https://github.com/drobilla/pugl/blob/eada1042452e8708ca6c65f7c23ac3c59e4c53f0/pugl/pugl_x11.c#L86

        if(display==NULL)
        {
                fprintf(stderr, "Error: XOpenDisplay(0) failed\n");
                return 1;
        }

Eg. DISPLAY=:3 ./pugl_program If no X Server is running on :3, allow to terminate nicely.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 20 (13 by maintainers)

Most upvoted comments

Or then use a bloated framework that offers menus

Bingo. Pugl is for single window UIs that work everywhere. Think more along the lines of games, and less along the lines of Windows 95. Countless apps have done just fine within those limitations.

Video mode and fullscreen support and such is more appropriate, because phones or WMless RPi installations or whatever count as “everywhere”.