depot/third_party/nixpkgs/pkgs/development/libraries/qt-6/patches/qtmultimedia-windows-resolve-function-name.patch
Default email 587713944a Project import generated by Copybara.
GitOrigin-RevId: 6143fc5eeb9c4f00163267708e26191d1e918932
2024-04-21 17:54:59 +02:00

30 lines
1.1 KiB
Diff

diff --git a/src/plugins/multimedia/ffmpeg/qwincapturablewindows.cpp b/src/plugins/multimedia/ffmpeg/qwincapturablewindows.cpp
index aac77ae..71ffed6 100644
--- a/src/plugins/multimedia/ffmpeg/qwincapturablewindows.cpp
+++ b/src/plugins/multimedia/ffmpeg/qwincapturablewindows.cpp
@@ -42,11 +42,7 @@ static QString windowTitle(HWND hwnd) {
return QString::fromStdWString(buffer);
}
-QList<QCapturableWindow> QWinCapturableWindows::windows() const
-{
- QList<QCapturableWindow> result;
-
- auto windowHandler = [](HWND hwnd, LPARAM lParam) {
+static int __stdcall windowHandler(HWND hwnd, LPARAM lParam) {
if (!canCaptureWindow(hwnd))
return TRUE; // Ignore window and continue enumerating
@@ -58,7 +54,11 @@ QList<QCapturableWindow> QWinCapturableWindows::windows() const
windows.push_back(windowData.release()->create());
return TRUE;
- };
+}
+
+QList<QCapturableWindow> QWinCapturableWindows::windows() const
+{
+ QList<QCapturableWindow> result;
::EnumWindows(windowHandler, reinterpret_cast<LPARAM>(&result));