Преглед изворни кода

libobs: Also determine WinUI 3 Window

qhy040404 пре 1 година
родитељ
комит
32b3517ef1

+ 4 - 2
libobs/util/windows/window-helpers.c

@@ -326,7 +326,8 @@ bool ms_is_uwp_window(HWND hwnd)
 	if (!GetClassNameW(hwnd, name, sizeof(name) / sizeof(wchar_t)))
 		return false;
 
-	return wcscmp(name, L"ApplicationFrameWindow") == 0;
+	return wcscmp(name, L"ApplicationFrameWindow") == 0 ||
+	       wcscmp(name, L"WinUIDesktopWin32WindowClass") == 0;
 }
 
 HWND ms_get_uwp_actual_window(HWND parent)
@@ -499,7 +500,8 @@ static bool is_generic_class(const char *current_class)
 
 static bool is_uwp_class(const char *window_class)
 {
-	return strcmp(window_class, "Windows.UI.Core.CoreWindow") == 0;
+	return strcmp(window_class, "Windows.UI.Core.CoreWindow") == 0 ||
+	       strcmp(window_class, "WinUIDesktopWin32WindowClass") == 0;
 }
 
 HWND ms_find_window(enum window_search_mode mode, enum window_priority priority,

+ 14 - 0
plugins/win-capture/data/compatibility.json

@@ -114,6 +114,20 @@
             "message": "UWP applications may not be capturable using the selected Capture Method (BitBlt).",
             "url": ""
         },
+	{
+            "name": "WinUI 3",
+            "translation_key": "Compatibility.WindowCapture.BitBlt.Applications",
+            "severity": 0,
+            "executable": "",
+            "window_class": "WinUIDesktopWin32WindowClass",
+            "window_title": "",
+            "match_flags": 4,
+            "game_capture": false,
+            "window_capture": true,
+            "window_capture_wgc": false,
+            "message": "WinUI 3 applications may not be capturable using the selected Capture Method (BitBlt).",
+            "url": ""
+        },
         {
             "name": "Gaming Services",
             "translation_key": "Compatibility.WindowCapture.BitBlt.Applications",

+ 1 - 0
plugins/win-capture/window-capture.c

@@ -126,6 +126,7 @@ static const char *wgc_partial_match_classes[] = {
 static const char *wgc_whole_match_classes[] = {
 	"ApplicationFrameWindow",
 	"Windows.UI.Core.CoreWindow",
+	"WinUIDesktopWin32WindowClass",
 	"GAMINGSERVICESUI_HOSTING_WINDOW_CLASS",
 	"XLMAIN",            /* Microsoft Excel */
 	"PPTFrameClass",     /* Microsoft PowerPoint */