From 836f8ab33cb85d437e4ec68edb1b7372899fefce Mon Sep 17 00:00:00 2001 From: Felix Rieseberg Date: Thu, 26 May 2016 10:06:42 -0700 Subject: [PATCH] :bug: Fix setFullscreen() on Windows This ensures that a BrowserWindow responds to `setFullscreen(true)` if `full screenable` was not defined during creation. This bug was on Windows only. --- atom/browser/native_window.cc | 5 +++++ docs/api/browser-window.md | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/atom/browser/native_window.cc b/atom/browser/native_window.cc index 2379bdd053..22fcdc1732 100644 --- a/atom/browser/native_window.cc +++ b/atom/browser/native_window.cc @@ -146,6 +146,11 @@ void NativeWindow::InitFromOptions(const mate::Dictionary& options) { bool fullscreen = false; if (options.Get(options::kFullscreen, &fullscreen) && !fullscreen) fullscreenable = false; + // On Windows, we can only enter fullscreen via API + // Ensure that setFullscreen(true) is usable by default + #if defined(OS_WIN) + fullscreenable = true; + #endif // Overriden by 'fullscreenable'. options.Get(options::kFullScreenable, &fullscreenable); SetFullScreenable(fullscreenable); diff --git a/docs/api/browser-window.md b/docs/api/browser-window.md index 7289057b40..b09e254d4d 100644 --- a/docs/api/browser-window.md +++ b/docs/api/browser-window.md @@ -59,8 +59,9 @@ It creates a new `BrowserWindow` with native properties as set by the `options`. * `fullscreen` Boolean - Whether the window should show in fullscreen. When explicity set to `false` the fullscreen button will be hidden or disabled on OS X. Default is `false`. - * `fullscreenable` Boolean - Whether the maximize/zoom button on OS X should - toggle full screen mode or maximize window. Default is `true`. + * `fullscreenable` Boolean - Whether the window can be put into fullscreen + mode. On OS X, also whether the maximize/zoom button should toggle full + screen mode or maximize window. Default is `true`. * `skipTaskbar` Boolean - Whether to show the window in taskbar. Default is `false`. * `kiosk` Boolean - The kiosk mode. Default is `false`.