diff --git a/atom/browser/api/atom_api_window.cc b/atom/browser/api/atom_api_window.cc index 985bc563cbb..49ebe464c3e 100644 --- a/atom/browser/api/atom_api_window.cc +++ b/atom/browser/api/atom_api_window.cc @@ -92,11 +92,9 @@ Window::Window(v8::Isolate* isolate, v8::Local wrapper, // Offscreen windows are always created frameless. bool offscreen; - if (web_preferences.Get("offscreen", &offscreen)) { - if (offscreen) { - auto window_options = const_cast(options); - window_options.Set(options::kFrame, false); - } + 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.