From 436a6d5c0ffca72eca7cbe2916250428a575ea19 Mon Sep 17 00:00:00 2001 From: Daijiro Wachi Date: Sat, 14 Jan 2017 00:04:51 +0100 Subject: [PATCH] Save a fullScreen state for Kiosk mode --- atom/browser/native_window_mac.h | 2 ++ atom/browser/native_window_mac.mm | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/atom/browser/native_window_mac.h b/atom/browser/native_window_mac.h index d5b1b50153..759e51e362 100644 --- a/atom/browser/native_window_mac.h +++ b/atom/browser/native_window_mac.h @@ -162,6 +162,8 @@ class NativeWindowMac : public NativeWindow, bool is_kiosk_; + bool was_fullscreen_; + bool zoom_to_page_width_; NSInteger attention_request_id_; // identifier from requestUserAttention diff --git a/atom/browser/native_window_mac.mm b/atom/browser/native_window_mac.mm index 76d9a37281..15e3cb4439 100644 --- a/atom/browser/native_window_mac.mm +++ b/atom/browser/native_window_mac.mm @@ -619,6 +619,7 @@ NativeWindowMac::NativeWindowMac( NativeWindow* parent) : NativeWindow(web_contents, options, parent), is_kiosk_(false), + was_fullscreen_(false), zoom_to_page_width_(false), attention_request_id_(0), title_bar_style_(NORMAL) { @@ -1126,10 +1127,11 @@ void NativeWindowMac::SetKiosk(bool kiosk) { NSApplicationPresentationDisableHideApplication; [NSApp setPresentationOptions:options]; is_kiosk_ = true; + was_fullscreen_ = IsFullscreen(); SetFullScreen(true); } else if (!kiosk && is_kiosk_) { is_kiosk_ = false; - SetFullScreen(false); + if (!was_fullscreen_) SetFullScreen(false); [NSApp setPresentationOptions:kiosk_options_]; } }