NSInteger attention_request_id_; // identifier from requestUserAttention
+ // The presentation options before entering kiosk mode.
+ NSApplicationPresentationOptions kiosk_options_;
+
// For system drag, the whole window is draggable and the non-draggable areas
// have to been explicitly excluded.
std::vector<gfx::Rect> system_drag_exclude_areas_;
}
void NativeWindowMac::SetKiosk(bool kiosk) {
- if (kiosk) {
+ if (kiosk && !is_kiosk_) {
+ kiosk_options_ = [NSApp currentSystemPresentationOptions];
NSApplicationPresentationOptions options =
NSApplicationPresentationHideDock +
NSApplicationPresentationHideMenuBar +
[NSApp setPresentationOptions:options];
is_kiosk_ = true;
SetFullscreen(true);
- } else {
- [NSApp setPresentationOptions:[NSApp currentSystemPresentationOptions]];
- is_kiosk_ = false;
+ } else if (!kiosk && is_kiosk_) {
+ is_kiosk_ = false;
SetFullscreen(false);
+ [NSApp setPresentationOptions:kiosk_options_];
}
}