Merge pull request #8250 from gerhardberger/osr-window-size-fix

Always create offscreen window frameless
This commit is contained in:
Kevin Sawicki 2016-12-29 09:10:14 -08:00 committed by GitHub
commit 6ea1bacc73
2 changed files with 9 additions and 0 deletions

View file

@ -90,6 +90,13 @@ Window::Window(v8::Isolate* isolate, v8::Local<v8::Object> wrapper,
if (options.Get("transparent", &transparent)) if (options.Get("transparent", &transparent))
web_preferences.Set("transparent", transparent); web_preferences.Set("transparent", transparent);
// Offscreen windows are always created frameless.
bool offscreen;
if (web_preferences.Get("offscreen", &offscreen) && offscreen) {
auto window_options = const_cast<mate::Dictionary&>(options);
window_options.Set(options::kFrame, false);
}
// Creates the WebContents used by BrowserWindow. // Creates the WebContents used by BrowserWindow.
web_contents = WebContents::Create(isolate, web_preferences); web_contents = WebContents::Create(isolate, web_preferences);
} }

View file

@ -12,6 +12,8 @@ when there is nothing happening on a webpage, no frames are generated. The
maximum frame rate is 60, because above that there is no benefit, just maximum frame rate is 60, because above that there is no benefit, just
performance loss. performance loss.
**Note:** An offscreen window is always created as a [Frameless Window](../api/frameless-window.md).
## Two modes of rendering ## Two modes of rendering
### GPU accelerated ### GPU accelerated