diff --git a/CefSharp.Core/BrowserSettings.h b/CefSharp.Core/BrowserSettings.h index 9b9060e77..9b3c3332d 100644 --- a/CefSharp.Core/BrowserSettings.h +++ b/CefSharp.Core/BrowserSettings.h @@ -73,6 +73,8 @@ namespace CefSharp { private: bool _isFinalized; + Nullable^ _offscreenTransparentBackground; + internal: CefBrowserSettings* _browserSettings; @@ -274,5 +276,11 @@ namespace CefSharp void set(Nullable^ value) { _browserSettings->webgl = CefStateFromDisabledSetting(value); } } + property Nullable^ OffscreenTransparentBackground + { + Nullable^ get() { return _offscreenTransparentBackground; } + void set(Nullable^ value) { _offscreenTransparentBackground = value; } + } + }; } \ No newline at end of file diff --git a/CefSharp.Core/ManagedCefBrowserAdapter.h b/CefSharp.Core/ManagedCefBrowserAdapter.h index c796e702d..355600010 100644 --- a/CefSharp.Core/ManagedCefBrowserAdapter.h +++ b/CefSharp.Core/ManagedCefBrowserAdapter.h @@ -75,7 +75,8 @@ namespace CefSharp auto hwnd = static_cast(windowHandle.ToPointer()); CefWindowInfo window; - window.SetAsWindowless(hwnd, TRUE); + bool transparent = !(browserSettings->OffscreenTransparentBackground->HasValue) || browserSettings->OffscreenTransparentBackground->Value; + window.SetAsWindowless(hwnd, transparent); CefString addressNative = StringUtils::ToNative(address); if (!CefBrowserHost::CreateBrowser(window, _clientAdapter.get(), addressNative,