mirror of
https://github.com/glfw/glfw.git
synced 2025-10-05 06:06:36 +00:00
Handle transparency checks per platform, instead of in context.c
This is needed because windows uses DWM for transparency, and that happens at a different stage inside of win32_window.c. This commit ensures framebuffer.transparent hint is updated once a match is confirmed (or lack of a match).
This commit is contained in:
parent
445e0c102d
commit
59fdba8057
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user