fix: simpleFullScreen exits when web content calls requestFullscreen (#50874)

fix: simpleFullScreen exits when web content calls requestFullscreen

SetHtmlApiFullscreen only checked IsFullscreen() to detect that the
window was already fullscreen, missing the simple-fullscreen case on
macOS. When web content triggered requestFullscreen the code fell
through to SetFullScreen(true) which toggled simple fullscreen off.

Include IsSimpleFullScreen() in the guard so the HTML-API fullscreen
state is updated without touching the window's fullscreen mode.
This commit is contained in:
Shelley Vohr
2026-04-13 02:06:07 +02:00
committed by GitHub
parent ea757689b3
commit a007bafaf1
2 changed files with 22 additions and 1 deletions

View File

@@ -4509,7 +4509,8 @@ void WebContents::OnDevToolsSearchCompleted(
void WebContents::SetHtmlApiFullscreen(bool enter_fullscreen) {
// Window is already in fullscreen mode, save the state.
if (enter_fullscreen && owner_window()->IsFullscreen()) {
if (enter_fullscreen && (owner_window()->IsFullscreen() ||
owner_window()->IsSimpleFullScreen())) {
native_fullscreen_ = true;
UpdateHtmlApiFullscreen(true);
return;