Skip to content

Commit 5c76fbf

Browse files
committed
[Transparency][WIN] fix white popup on startup when specifying transparent window
1 parent e308c2d commit 5c76fbf

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/browser/native_window_aura.cc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
#include "content/public/browser/native_web_keyboard_event.h"
4646
#include "content/public/browser/render_view_host.h"
4747
#include "content/browser/renderer_host/render_view_host_impl.h"
48+
#include "content/public/browser/render_widget_host_view.h"
4849
#include "content/public/browser/web_contents.h"
4950
#include "content/public/common/content_switches.h"
5051
#include "extensions/common/draggable_region.h"
@@ -496,6 +497,15 @@ void NativeWindowAura::SetTransparent(bool transparent) {
496497
toolbar_->SchedulePaint();
497498
}
498499

500+
// this is needed to prevent white popup on startup
501+
content::RenderWidgetHostView* rwhv = shell_->web_contents()->GetRenderWidgetHostView();
502+
if (rwhv) {
503+
if (transparent)
504+
rwhv->SetBackgroundColor(SK_ColorTRANSPARENT);
505+
else
506+
rwhv->SetBackgroundColorToDefault();
507+
}
508+
499509
content::RenderViewHostImpl* rvh = static_cast<content::RenderViewHostImpl*>(shell_->web_contents()->GetRenderViewHost());
500510
if (rvh) {
501511
rvh->SetBackgroundOpaque(!transparent);

0 commit comments

Comments
 (0)