Handle transparent WebContents in api::BrowserWindow
This commit is contained in:
parent
c611eb061d
commit
c87fc2426d
2 changed files with 5 additions and 5 deletions
|
@ -30,6 +30,7 @@
|
||||||
#include "native_mate/constructor.h"
|
#include "native_mate/constructor.h"
|
||||||
#include "native_mate/dictionary.h"
|
#include "native_mate/dictionary.h"
|
||||||
#include "ui/gfx/geometry/rect.h"
|
#include "ui/gfx/geometry/rect.h"
|
||||||
|
#include "ui/gl/gpu_switching_manager.h"
|
||||||
|
|
||||||
#if defined(TOOLKIT_VIEWS)
|
#if defined(TOOLKIT_VIEWS)
|
||||||
#include "atom/browser/native_window_views.h"
|
#include "atom/browser/native_window_views.h"
|
||||||
|
@ -155,6 +156,10 @@ void BrowserWindow::Init(v8::Isolate* isolate,
|
||||||
web_contents->SetOwnerWindow(window_.get());
|
web_contents->SetOwnerWindow(window_.get());
|
||||||
window_->set_is_offscreen_dummy(api_web_contents_->IsOffScreen());
|
window_->set_is_offscreen_dummy(api_web_contents_->IsOffScreen());
|
||||||
|
|
||||||
|
// Tell the content module to initialize renderer widget with transparent
|
||||||
|
// mode.
|
||||||
|
ui::GpuSwitchingManager::SetTransparent(window_->transparent());
|
||||||
|
|
||||||
#if defined(TOOLKIT_VIEWS)
|
#if defined(TOOLKIT_VIEWS)
|
||||||
// Sets the window icon.
|
// Sets the window icon.
|
||||||
mate::Handle<NativeImage> icon;
|
mate::Handle<NativeImage> icon;
|
||||||
|
|
|
@ -38,7 +38,6 @@
|
||||||
#include "ui/gfx/geometry/rect.h"
|
#include "ui/gfx/geometry/rect.h"
|
||||||
#include "ui/gfx/geometry/size.h"
|
#include "ui/gfx/geometry/size.h"
|
||||||
#include "ui/gfx/geometry/size_conversions.h"
|
#include "ui/gfx/geometry/size_conversions.h"
|
||||||
#include "ui/gl/gpu_switching_manager.h"
|
|
||||||
|
|
||||||
#if defined(OS_LINUX) || defined(OS_WIN)
|
#if defined(OS_LINUX) || defined(OS_WIN)
|
||||||
#include "content/public/common/renderer_preferences.h"
|
#include "content/public/common/renderer_preferences.h"
|
||||||
|
@ -87,10 +86,6 @@ NativeWindow::NativeWindow(
|
||||||
prefs->subpixel_rendering = params.subpixel_rendering;
|
prefs->subpixel_rendering = params.subpixel_rendering;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Tell the content module to initialize renderer widget with transparent
|
|
||||||
// mode.
|
|
||||||
ui::GpuSwitchingManager::SetTransparent(transparent_);
|
|
||||||
|
|
||||||
WindowList::AddWindow(this);
|
WindowList::AddWindow(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue