From 820cdc797d157c71c0cef47750eab8bdd9995049 Mon Sep 17 00:00:00 2001 From: Bruno Tavares Date: Wed, 29 Jun 2022 15:41:40 -0300 Subject: [PATCH] Fix VersionUnavailable warning When building an app on hover, we are getting the following error ``` GLFW: An uncaught error has occurred: VersionUnavailable: NSGL: Failed to create OpenGL context ``` This is happening when the Resource Window is created in background. The Version hint requirements is being reverted to the initial values after we create the main window, so the resource window does not have a version hint set. This commit calls the global version hint code after we reset it, to ensure the resource window have it set. This fixes the warning, but it's not the actual root-cause to the Flutter 3.0 errors. It is another warning that is misleading the investigation on that bug. --- application.go | 1 + 1 file changed, 1 insertion(+) diff --git a/application.go b/application.go index ecbc115..535d236 100644 --- a/application.go +++ b/application.go @@ -69,6 +69,7 @@ func NewApplication(opt ...Option) *Application { // Though optional, it is recommended that all embedders set this callback as // it will lead to better performance in texture handling. func createResourceWindow(window *glfw.Window) (*glfw.Window, error) { + opengl.GLFWWindowHint() glfw.WindowHint(glfw.Decorated, glfw.False) glfw.WindowHint(glfw.Visible, glfw.False) if runtime.GOOS == "linux" {