Skip to content

Commit 100ff1c

Browse files
jefry-vcuberogerwang
authored andcommitted
[Transparency][WIN] fix white popup on startup when specifying transparent window
1 parent 7a4ca7e commit 100ff1c

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"
@@ -498,6 +499,15 @@ void NativeWindowAura::SetTransparent(bool transparent) {
498499
toolbar_->SchedulePaint();
499500
}
500501

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

0 commit comments

Comments
 (0)