Fix 'Image will be cropped if WindowCapturerWinGdi used'

Bug: webrtc:15719
Change-Id: I7daf8ee5b90fbe9f1246f1d99211ffa0d8a19f73
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/330780
Reviewed-by: Alexander Cooper <alcooper@chromium.org>
Commit-Queue: Alexander Cooper <alcooper@chromium.org>
Cr-Commit-Position: refs/heads/main@{#41503}
diff --git a/AUTHORS b/AUTHORS
index 6e92240..968c896 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -120,6 +120,7 @@
 Stefan Gula <steweg@gmail.com>
 Stephan Hartmann <stha09@googlemail.com>
 Steve Reid <sreid@sea-to-sky.net>
+Tao chen <meemetao@gmail.com>
 Takaaki Suzuki <takaakisuzuki.14@gmail.com>
 Tarun Chawla <trnkumarchawla@gmail.com>
 Todd Wong <todd.wong.ndq@gmail.com>
diff --git a/modules/desktop_capture/win/window_capture_utils.cc b/modules/desktop_capture/win/window_capture_utils.cc
index ccfef49..13f498f 100644
--- a/modules/desktop_capture/win/window_capture_utils.cc
+++ b/modules/desktop_capture/win/window_capture_utils.cc
@@ -183,6 +183,13 @@
       is_maximized) {
     // Only apply this cropping to windows with a resize border (otherwise,
     // it'd clip the edges of captured pop-up windows without this border).
+    RECT rect;
+    DwmGetWindowAttribute(window, DWMWA_EXTENDED_FRAME_BOUNDS, &rect,
+                          sizeof(RECT));
+    // it's means that the window edge is not transparent
+    if (rect.left == original_rect->left()) {
+      return true;
+    }
     LONG style = GetWindowLong(window, GWL_STYLE);
     if (style & WS_THICKFRAME || style & DS_MODALFRAME) {
       int width = GetSystemMetrics(SM_CXSIZEFRAME);