From 1fd6f0dd3af3183c0b41b94eae1379f8e60f3d96 Mon Sep 17 00:00:00 2001 From: Albrecht Schlosser Date: Sat, 7 Oct 2023 17:14:11 +0200 Subject: Fix STR 3458: "GLUT compatibility mode segfaults" ... "when there's no current window". Silently ignore GLUT function calls that need a current window if the current window is NULL, return 0 from functions that return an 'int'. Check if window is shown in Fl_X11_Gl_Window_Driver::swap_buffers(). This would issue "XRequest.nnn: GLXBadDrawable 0x0" on X11 otherwise. Note: the chosen implementation to ignore GLUT calls silently appears to be compatible with GLUT (3.7) whereas FreeGLUT 3.0 would issue error messages and exit. The latter could be implemented as well but would be much more work. --- test/Makefile | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'test/Makefile') diff --git a/test/Makefile b/test/Makefile index b79a9f766..e73431b03 100644 --- a/test/Makefile +++ b/test/Makefile @@ -75,6 +75,7 @@ CPPFILES =\ fullscreen.cxx \ gl_overlay.cxx \ glpuzzle.cxx \ + glut_test.cxx \ hello.cxx \ help_dialog.cxx \ icon.cxx \ @@ -226,6 +227,7 @@ GLALL = \ fullscreen$(EXEEXT) \ gl_overlay$(EXEEXT) \ glpuzzle$(EXEEXT) \ + glut_test$(EXEEXT) \ shape$(EXEEXT) \ unittests$(EXEEXT) @@ -661,6 +663,11 @@ gl_overlay$(EXEEXT): gl_overlay.o $(CXX) $(ARCHFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@ gl_overlay.o $(LINKFLTKGL) $(LINKFLTK) $(GLDLIBS) $(OSX_ONLY) ../fltk-config --post $@ +glut_test$(EXEEXT): glut_test.o + echo Linking $@... + $(CXX) $(ARCHFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@ glut_test.o $(LINKFLTKGL) $(LINKFLTK) $(GLDLIBS) + $(OSX_ONLY) ../fltk-config --post $@ + unittests$(EXEEXT): $(OBJUNITTEST) echo Linking $@... $(CXX) $(ARCHFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@ $(OBJUNITTEST) $(LINKFLTKGL) $(LINKFLTK) $(GLDLIBS) -- cgit v1.2.3