diff --git a/atom/browser/api/atom_api_window.cc b/atom/browser/api/atom_api_window.cc index 3358f108573..49ebe464c3e 100644 --- a/atom/browser/api/atom_api_window.cc +++ b/atom/browser/api/atom_api_window.cc @@ -90,6 +90,13 @@ Window::Window(v8::Isolate* isolate, v8::Local wrapper, if (options.Get("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(options); + window_options.Set(options::kFrame, false); + } + // Creates the WebContents used by BrowserWindow. web_contents = WebContents::Create(isolate, web_preferences); } diff --git a/docs/tutorial/offscreen-rendering.md b/docs/tutorial/offscreen-rendering.md index e47967bd35b..4c3024bdc68 100644 --- a/docs/tutorial/offscreen-rendering.md +++ b/docs/tutorial/offscreen-rendering.md @@ -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 performance loss. +**Note:** An offscreen window is always created as a [Frameless Window](../api/frameless-window.md). + ## Two modes of rendering ### GPU accelerated