fix(window): enter fullscreen from maximized windows (#4034) (#4903)

The fullscreen toggle had an isMaximized branch (from #872) that called
unmaximize() and never setFullscreen() when the window was maximized. Phosh
windows are always maximized, so the button appeared to do nothing; on Windows
it only worked when the window was not maximized.

Toggle fullscreen unconditionally. The maximize handler already exits
fullscreen first, so the two controls stay consistent.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Huang Xin
2026-07-03 03:51:57 +09:00
committed by GitHub
parent c5304cd46c
commit 84c5a9dae6
2 changed files with 65 additions and 7 deletions
+5 -6
View File
@@ -71,12 +71,11 @@ export const tauriHandleOnCloseWindow = async (callback: () => void) => {
export const tauriHandleToggleFullScreen = async () => {
const currentWindow = getCurrentWindow();
const isFullscreen = await currentWindow.isFullscreen();
const isMaximized = await currentWindow.isMaximized();
if (isMaximized) {
await currentWindow.unmaximize();
} else {
await currentWindow.setFullscreen(!isFullscreen);
}
// Toggle fullscreen regardless of the maximized state. Previously a maximized
// window was only unmaximized here, so the fullscreen button did nothing when
// the window was maximized, which is always the case on mobile shells like
// Phosh and common on Windows (issue #4034).
await currentWindow.setFullscreen(!isFullscreen);
if ((await osType()) === 'linux') {
linuxWindowRestoreTransparentBg();
}