avdevice/gdigrab: make overlay window layered

WS_EX_LAYERED allows input events to pass through to windows beneath.

WS_EX_NOACTIVATE prevents the window from stealing focus when created.
This commit is contained in:
Hunter Kvalevog
2026-06-10 12:56:20 +00:00
committed by michaelni
co-authored by michaelni
parent dc1128e475
commit 54749da98a
+3 -1
View File
@@ -134,7 +134,8 @@ gdigrab_region_wnd_task(LPVOID opaque)
MSG msg; MSG msg;
DWORD style = WS_POPUP | WS_VISIBLE; DWORD style = WS_POPUP | WS_VISIBLE;
DWORD ex = WS_EX_TOOLWINDOW | WS_EX_TOPMOST | WS_EX_TRANSPARENT; DWORD ex = WS_EX_LAYERED | WS_EX_NOACTIVATE | WS_EX_TOOLWINDOW |
WS_EX_TOPMOST | WS_EX_TRANSPARENT;
rect.left -= REGION_WND_BORDER; rect.top -= REGION_WND_BORDER; rect.left -= REGION_WND_BORDER; rect.top -= REGION_WND_BORDER;
rect.right += REGION_WND_BORDER; rect.bottom += REGION_WND_BORDER; rect.right += REGION_WND_BORDER; rect.bottom += REGION_WND_BORDER;
@@ -170,6 +171,7 @@ gdigrab_region_wnd_task(LPVOID opaque)
DeleteObject(region_interior); DeleteObject(region_interior);
SetWindowLongPtr(hwnd, GWLP_WNDPROC, (LONG_PTR) gdigrab_region_wnd_proc); SetWindowLongPtr(hwnd, GWLP_WNDPROC, (LONG_PTR) gdigrab_region_wnd_proc);
SetLayeredWindowAttributes(hwnd, 0, 0xFF, LWA_ALPHA);
ShowWindow(hwnd, SW_SHOW); ShowWindow(hwnd, SW_SHOW);