From c5a870ebd9280f72272b3d655b840fcb3a85b51f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Tue, 5 Nov 2019 18:55:42 +0100 Subject: [PATCH] Win32: Change transparent framebuffer key color This is a temporary fix while we determine if the color key workaround should be removed completely. See issue thread for discussion. Related to #1512. (cherry picked from commit c88ee1c9d3e018c199eaf0b0f5ccc3874ac1de09) --- docs/window.dox | 7 +++++++ src/win32_window.c | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/window.dox b/docs/window.dox index d7a3563d..6109fbf5 100644 --- a/docs/window.dox +++ b/docs/window.dox @@ -234,6 +234,13 @@ alpha channel will be used to combine the framebuffer with the background. This does not affect window decorations. Possible values are `GLFW_TRUE` and `GLFW_FALSE`. +@par +@win32 GLFW sets a color key for the window to work around repainting issues +with a transparent framebuffer. The chosen color value is RGB 255,0,255 +(magenta). This will make pixels with that exact color fully transparent +regardless of their alpha values. If this is a problem, make these pixels any +other color before buffer swap. + @anchor GLFW_FOCUS_ON_SHOW_hint __GLFW_FOCUS_ON_SHOW__ specifies whether the window will be given input focus when @ref glfwShowWindow is called. Possible values are `GLFW_TRUE` and `GLFW_FALSE`. diff --git a/src/win32_window.c b/src/win32_window.c index 29ade445..cdb1fe87 100644 --- a/src/win32_window.c +++ b/src/win32_window.c @@ -411,7 +411,7 @@ static void updateFramebufferTransparency(const _GLFWwindow* window) // issue. When set to black, something is making the hit test // not resize with the window frame. SetLayeredWindowAttributes(window->win32.handle, - RGB(0, 193, 48), 255, LWA_COLORKEY); + RGB(255, 0, 255), 255, LWA_COLORKEY); } DeleteObject(region);