diff --git a/src/context.c b/src/context.c index 3c0d5e657..3842f0a37 100644 --- a/src/context.c +++ b/src/context.c @@ -318,12 +318,6 @@ const _GLFWfbconfig* _glfwChooseFBConfig(const _GLFWfbconfig* desired, } } - if (desired->transparent && closest->transparent != GLFW_TRUE) - { - // If we couldn't find a transparency match, - // update the fb hint for client checking. - _glfw.hints.framebuffer.transparent = GLFW_FALSE; - } return closest; } diff --git a/src/egl_context.c b/src/egl_context.c index bf3130c64..587fd5d30 100644 --- a/src/egl_context.c +++ b/src/egl_context.c @@ -188,6 +188,9 @@ static GLFWbool chooseEGLConfig(const _GLFWctxconfig* ctxconfig, if (closest) *result = (EGLConfig) closest->handle; + if (desired->transparent && closest->transparent != GLFW_TRUE) + _glfw.hints.framebuffer.transparent = GLFW_FALSE; + free(nativeConfigs); free(usableConfigs); diff --git a/src/glx_context.c b/src/glx_context.c index 48c0ac3a7..32d1ef517 100644 --- a/src/glx_context.c +++ b/src/glx_context.c @@ -141,6 +141,9 @@ static GLFWbool chooseGLXFBConfig(const _GLFWfbconfig* desired, if (closest) *result = (GLXFBConfig) closest->handle; + if (desired->transparent && closest->transparent != GLFW_TRUE) + _glfw.hints.framebuffer.transparent = GLFW_FALSE; + XFree(nativeConfigs); free(usableConfigs); diff --git a/src/win32_window.c b/src/win32_window.c index a6491aee4..4356983e4 100644 --- a/src/win32_window.c +++ b/src/win32_window.c @@ -988,6 +988,7 @@ static int createNativeWindow(_GLFWwindow* window, WCHAR* wideTitle; DWORD style = getWindowStyle(window); DWORD exStyle = getWindowExStyle(window); + GLFWbool transparent = GLFW_FALSE; if (window->monitor) { @@ -1061,6 +1062,7 @@ static int createNativeWindow(_GLFWwindow* window, bb.dwFlags = DWM_BB_ENABLE | DWM_BB_BLURREGION; bb.hRgnBlur = region; bb.fEnable = TRUE; + transparent = GLFW_TRUE; if (SUCCEEDED(DwmEnableBlurBehindWindow(window->win32.handle, &bb))) { @@ -1090,6 +1092,9 @@ static int createNativeWindow(_GLFWwindow* window, DeleteObject(region); } + // Need to let the framebuffer hint aware of the composition results. + _glfw.hints.framebuffer.transparent = transparent; + return GLFW_TRUE; }