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:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user