From f000b5dafff1cddd7b5b989bafed368fc75df244 Mon Sep 17 00:00:00 2001 From: bschaefer Date: Sat, 16 Apr 2016 16:27:42 -0700 Subject: [PATCH] Mir: Fix window/context creation order Need to create the native window before creating the context as creating the context creates the EGL surface. --- src/mir_window.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/mir_window.c b/src/mir_window.c index 6b6f4467..93a82624 100644 --- a/src/mir_window.c +++ b/src/mir_window.c @@ -345,12 +345,6 @@ int _glfwPlatformCreateWindow(_GLFWwindow* window, const _GLFWctxconfig* ctxconfig, const _GLFWfbconfig* fbconfig) { - if (ctxconfig->api != GLFW_NO_API) - { - if (!_glfwCreateContextEGL(window, ctxconfig, fbconfig)) - return GLFW_FALSE; - } - if (window->monitor) { GLFWvidmode mode; @@ -377,6 +371,12 @@ int _glfwPlatformCreateWindow(_GLFWwindow* window, window->mir.window = mir_buffer_stream_get_egl_native_window( mir_surface_get_buffer_stream(window->mir.surface)); + if (ctxconfig->api != GLFW_NO_API) + { + if (!_glfwCreateContextEGL(window, ctxconfig, fbconfig)) + return GLFW_FALSE; + } + return GLFW_TRUE; }