From 2a87244ae3450496120917af1d95d8e833fa270a Mon Sep 17 00:00:00 2001 From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> Date: Sat, 7 Sep 2024 16:50:14 +0200 Subject: [PATCH] Add support of GL with Wayland for Linux on Apple hardware --- src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.cxx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.cxx b/src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.cxx index 09758e422..384c4a205 100644 --- a/src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.cxx +++ b/src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.cxx @@ -209,6 +209,11 @@ void Fl_Wayland_Gl_Window_Driver::set_gl_context(Fl_Window* w, GLContext context Fl::error("eglMakeCurrent() failed\n"); } } + if (!(mode() & FL_ALPHA)) { // useful at least for Linux on MacBook hardware + GLfloat vals[4]; + glGetFloatv(GL_COLOR_CLEAR_VALUE, vals); + if (vals[3] == 0.) glClearColor(vals[0], vals[1], vals[2], 1.); + } } /* CONTROL_LEAKING_SUB_GL_WINDOWS