From e2790d635c031f0d0bfe458647297a1a59661a65 Mon Sep 17 00:00:00 2001 From: Seungha Yang Date: Mon, 16 Oct 2023 00:59:59 +0900 Subject: [PATCH] d3d11screencapturesrc: Fix HWND capture mode Use per-monitor-aware context to cover different DPI settings per monitor Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/2425 Part-of: --- .../gst-plugins-bad/sys/d3d11/gstd3d11winrtcapture.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/subprojects/gst-plugins-bad/sys/d3d11/gstd3d11winrtcapture.cpp b/subprojects/gst-plugins-bad/sys/d3d11/gstd3d11winrtcapture.cpp index 9beb13a620..8656718184 100644 --- a/subprojects/gst-plugins-bad/sys/d3d11/gstd3d11winrtcapture.cpp +++ b/subprojects/gst-plugins-bad/sys/d3d11/gstd3d11winrtcapture.cpp @@ -697,7 +697,7 @@ gst_d3d11_winrt_capture_thread_func (GstD3D11WinRTCapture * self) #endif winrt_vtable.SetThreadDpiAwarenessContext - (DPI_AWARENESS_CONTEXT_SYSTEM_AWARE); + (DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE); QueryPerformanceFrequency (&self->frequency); @@ -997,7 +997,7 @@ again: BOOL ret; prev = winrt_vtable.SetThreadDpiAwarenessContext - (DPI_AWARENESS_CONTEXT_SYSTEM_AWARE); + (DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE); ret = GetClientRect (self->window_handle, &client_rect) && DwmGetWindowAttribute (self->window_handle, DWMWA_EXTENDED_FRAME_BOUNDS, &bound_rect, sizeof (RECT)) == S_OK &&