Skip to content
This repository was archived by the owner on Jan 6, 2023. It is now read-only.

Commit eb9613a

Browse files
Restore support of transparent windows in the render widget host view
TODO: Validate when we get Electron building
1 parent 956769b commit eb9613a

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

patches/029-render_widget_host_view_mac.patch

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@ diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/cont
22
index faedde495761..c9d2beabd798 100644
33
--- a/content/browser/renderer_host/render_widget_host_view_mac.mm
44
+++ b/content/browser/renderer_host/render_widget_host_view_mac.mm
5+
@@ -88,6 +88,7 @@
6+
#include "ui/gfx/geometry/size_conversions.h"
7+
#include "ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h"
8+
#include "ui/gl/gl_switches.h"
9+
+#include "ui/gl/gpu_switching_manager.h"
10+
11+
using content::BrowserAccessibility;
12+
using content::BrowserAccessibilityManager;
513
@@ -138,6 +139,11 @@ RenderWidgetHostView* GetRenderWidgetHostViewToUse(
614

715
} // namespace
@@ -72,3 +80,16 @@ index faedde495761..c9d2beabd798 100644
7280
nil]);
7381
}
7482
return validAttributesForMarkedText_.get();
83+
@@ -1645,6 +1651,12 @@ new BrowserCompositorMac(this, this, render_widget_host_->is_hidden(),
84+
DCHECK(SkColorGetA(color) == SK_AlphaOPAQUE ||
85+
SkColorGetA(color) == SK_AlphaTRANSPARENT);
86+
bool opaque = SkColorGetA(color) == SK_AlphaOPAQUE;
87+
+ if (opaque) {
88+
+ bool wantsTransparent = ui::GpuSwitchingManager::UseTransparent() ||
89+
+ (self.window && ![self.window isOpaque]);
90+
+ if (wantsTransparent)
91+
+ opaque = NO;
92+
+ }
93+
if (background_is_opaque_ != opaque) {
94+
background_is_opaque_ = opaque;
95+
browser_compositor_->SetHasTransparentBackground(!opaque);

0 commit comments

Comments
 (0)