mac: Restore presentation options when leaving kiosk mode, fixes #272.
This commit is contained in:
parent
7d38fe61d2
commit
1d6b02f304
2 changed files with 8 additions and 4 deletions
|
@ -95,6 +95,9 @@ class NativeWindowMac : public NativeWindow {
|
|||
|
||||
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_;
|
||||
|
|
|
@ -409,7 +409,8 @@ void NativeWindowMac::FlashFrame(bool flash) {
|
|||
}
|
||||
|
||||
void NativeWindowMac::SetKiosk(bool kiosk) {
|
||||
if (kiosk) {
|
||||
if (kiosk && !is_kiosk_) {
|
||||
kiosk_options_ = [NSApp currentSystemPresentationOptions];
|
||||
NSApplicationPresentationOptions options =
|
||||
NSApplicationPresentationHideDock +
|
||||
NSApplicationPresentationHideMenuBar +
|
||||
|
@ -421,10 +422,10 @@ void NativeWindowMac::SetKiosk(bool kiosk) {
|
|||
[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_];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue