Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1050)

Unified Diff: webrtc/modules/desktop_capture/window_capturer_win.cc

Issue 1371383003: WebRtc Win Desktop capture: ignore Win8+ Modern Apps' windows. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/desktop_capture/window_capturer_win.cc
diff --git a/webrtc/modules/desktop_capture/window_capturer_win.cc b/webrtc/modules/desktop_capture/window_capturer_win.cc
index ba45eaa9d18a78d15ee3ed0c6c285e76bf089eb1..ed22917129afe995813aca0b05fb69b4ca3766e1 100644
--- a/webrtc/modules/desktop_capture/window_capturer_win.cc
+++ b/webrtc/modules/desktop_capture/window_capturer_win.cc
@@ -59,6 +59,23 @@ BOOL CALLBACK WindowsEnumerationHandler(HWND hwnd, LPARAM param) {
if (window.title.empty())
return TRUE;
+ // Filter out windows modern apps' windows based on the observation:
+ // When a modern app's window is in foreground and not minimized :
+ // class name = ApplicationFrameWindow
+ // When a modern app's window is in foreground and minimized :
+ // class name = windows.UI.Core.coreWindow
+ // when a modern app's window is in background:
+ // It is listed as two windows with class name = ApplicationFrameWindow
+ // and class name = windows.UI.Core.coreWindow.
+ // Webrtc is not able to capture modern apps' windows on 09/30/2015.
mcasas 2015/10/01 17:19:04 This is a bit too verbose :) Please rephrase more
gyzhou 2015/10/02 18:30:34 Done.
+ if (rtc::IsWindows8OrLater()) {
+ char clsName[1024];
mcasas 2015/10/01 17:19:04 This needs to be WCHAR right? Like in l.53.
gyzhou 2015/10/02 18:30:34 GetClassName using WCHAR as input GetClassNameA ca
+ GetClassNameA(hwnd, clsName, 1024);
mcasas 2015/10/01 17:19:04 What about the return value? and what is 1024? Su
gyzhou 2015/10/02 18:30:34 Done.
+ if (strcmp(clsName, "ApplicationFrameWindow") == 0 ||
+ strcmp(clsName, "Windows.UI.Core.CoreWindow") == 0)
mcasas 2015/10/01 17:19:04 Nit: I wouldn't use camlcase names ever, but if th
gyzhou 2015/10/02 18:30:34 Done.
+ return true;
+ }
+
list->push_back(window);
return TRUE;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698