mirror of
https://github.com/glfw/glfw.git
synced 2026-09-21 16:44:11 +00:00
Add support for mouse input transparency
This adds the GLFW_MOUSE_PASSTHROUGH window hint and attribute for controlling whether mouse input passes through the window to whatever window is behind it. Fixes #1236. Closes #1568.
This commit is contained in:
committed by
Camilla Löwy
parent
6c031af245
commit
d285a9fdeb
@@ -1201,6 +1201,13 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg,
|
||||
DragFinish(drop);
|
||||
return 0;
|
||||
}
|
||||
|
||||
case WM_NCHITTEST:
|
||||
{
|
||||
if (window->mousePassthrough)
|
||||
return HTTRANSPARENT;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return DefWindowProcW(hWnd, uMsg, wParam, lParam);
|
||||
@@ -1854,6 +1861,11 @@ void _glfwPlatformSetWindowFloating(_GLFWwindow* window, GLFWbool enabled)
|
||||
SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
|
||||
}
|
||||
|
||||
void _glfwPlatformSetWindowMousePassthrough(_GLFWwindow* window, GLFWbool enabled)
|
||||
{
|
||||
window->mousePassthrough = enabled;
|
||||
}
|
||||
|
||||
float _glfwPlatformGetWindowOpacity(_GLFWwindow* window)
|
||||
{
|
||||
BYTE alpha;
|
||||
|
||||
Reference in New Issue
Block a user