mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
fix: only exit fullscreen conditionally with setKiosk (#38219)
fix: only exit fullscreen conditionally with setKiosk
This commit is contained in:
@@ -234,6 +234,7 @@ class NativeWindowMac : public NativeWindow,
|
||||
// The views::View that fills the client area.
|
||||
std::unique_ptr<RootViewMac> root_view_;
|
||||
|
||||
bool fullscreen_before_kiosk_ = false;
|
||||
bool is_kiosk_ = false;
|
||||
bool zoom_to_page_width_ = false;
|
||||
absl::optional<gfx::Point> traffic_light_position_;
|
||||
|
||||
@@ -1029,10 +1029,13 @@ void NativeWindowMac::SetKiosk(bool kiosk) {
|
||||
NSApplicationPresentationDisableHideApplication;
|
||||
[NSApp setPresentationOptions:options];
|
||||
is_kiosk_ = true;
|
||||
SetFullScreen(true);
|
||||
fullscreen_before_kiosk_ = IsFullscreen();
|
||||
if (!fullscreen_before_kiosk_)
|
||||
SetFullScreen(true);
|
||||
} else if (!kiosk && is_kiosk_) {
|
||||
is_kiosk_ = false;
|
||||
SetFullScreen(false);
|
||||
if (!fullscreen_before_kiosk_)
|
||||
SetFullScreen(false);
|
||||
|
||||
// Set presentation options *after* asynchronously exiting
|
||||
// fullscreen to ensure they take effect.
|
||||
|
||||
Reference in New Issue
Block a user