diff --git a/internal/glfw/window_unix.c b/internal/glfw/window_unix.c index 514bd2c01..494b557f1 100644 --- a/internal/glfw/window_unix.c +++ b/internal/glfw/window_unix.c @@ -209,7 +209,7 @@ void glfwDefaultWindowHints(void) // The default is OpenGL with minimum version 1.0 memset(&_glfw.hints.context, 0, sizeof(_glfw.hints.context)); - _glfw.hints.context.client = GLFW_OPENGL_API; + _glfw.hints.context.client = GLFW_NO_API; // This is different from the original GLFW, which uses GLFW_OPENGL_API by default. _glfw.hints.context.source = GLFW_NATIVE_CONTEXT_API; _glfw.hints.context.major = 1; _glfw.hints.context.minor = 0; diff --git a/internal/glfw/window_windows.go b/internal/glfw/window_windows.go index 4ddfdde16..9ac995c9d 100644 --- a/internal/glfw/window_windows.go +++ b/internal/glfw/window_windows.go @@ -160,7 +160,7 @@ func defaultWindowHints() error { // The default is OpenGL with minimum version 1.0 _glfw.hints.context = ctxconfig{ - client: OpenGLAPI, + client: NoAPI, // This is different from the original GLFW, which uses OpenGLAPI by default. source: NativeContextAPI, major: 1, minor: 0, diff --git a/internal/ui/ui_glfw.go b/internal/ui/ui_glfw.go index e26354986..7f4fc09e4 100644 --- a/internal/ui/ui_glfw.go +++ b/internal/ui/ui_glfw.go @@ -1106,11 +1106,8 @@ func (u *UserInterface) initOnMainThread(options *RunOptions) error { u.setGraphicsLibrary(lib) u.graphicsDriver.SetTransparent(options.ScreenTransparent) - if u.GraphicsLibrary() != GraphicsLibraryOpenGL { - if err := glfw.WindowHint(glfw.ClientAPI, glfw.NoAPI); err != nil { - return err - } - } + // internal/glfw is customized and the default client API is NoAPI, not OpenGLAPI. + // Then, glfw.WindowHint(glfw.ClientAPI, glfw.NoAPI) doesn't have to be called. // Before creating a window, set it unresizable no matter what u.isInitWindowResizable() is (#1987). // Making the window resizable here doesn't work correctly when switching to enable resizing.