* Implement last window's fullscreen state (#2495)

This commit is contained in:
PikachuEXE 2022-09-20 20:49:45 +08:00 committed by GitHub
parent 8db6b8104f
commit d8de7fe06f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -251,7 +251,8 @@ function runApp() {
const boundsDoc = await baseHandlers.settings._findBounds()
if (typeof boundsDoc?.value === 'object') {
const { maximized, ...bounds } = boundsDoc.value
console.log({ boundsDoc })
const { maximized, fullScreen, ...bounds } = boundsDoc.value
const allDisplaysSummaryWidth = screen
.getAllDisplays()
.reduce((accumulator, { size: { width } }) => accumulator + width, 0)
@ -268,6 +269,10 @@ function runApp() {
if (maximized) {
newWindow.maximize()
}
if (fullScreen) {
newWindow.setFullScreen(true)
}
}
// If called multiple times
@ -322,7 +327,8 @@ function runApp() {
const value = {
...newWindow.getNormalBounds(),
maximized: newWindow.isMaximized()
maximized: newWindow.isMaximized(),
fullScreen: newWindow.isFullScreen()
}
await baseHandlers.settings._updateBounds(value)