* Implement last window's fullscreen state (#2495)
This commit is contained in:
parent
8db6b8104f
commit
d8de7fe06f
|
@ -251,7 +251,8 @@ function runApp() {
|
||||||
|
|
||||||
const boundsDoc = await baseHandlers.settings._findBounds()
|
const boundsDoc = await baseHandlers.settings._findBounds()
|
||||||
if (typeof boundsDoc?.value === 'object') {
|
if (typeof boundsDoc?.value === 'object') {
|
||||||
const { maximized, ...bounds } = boundsDoc.value
|
console.log({ boundsDoc })
|
||||||
|
const { maximized, fullScreen, ...bounds } = boundsDoc.value
|
||||||
const allDisplaysSummaryWidth = screen
|
const allDisplaysSummaryWidth = screen
|
||||||
.getAllDisplays()
|
.getAllDisplays()
|
||||||
.reduce((accumulator, { size: { width } }) => accumulator + width, 0)
|
.reduce((accumulator, { size: { width } }) => accumulator + width, 0)
|
||||||
|
@ -268,6 +269,10 @@ function runApp() {
|
||||||
if (maximized) {
|
if (maximized) {
|
||||||
newWindow.maximize()
|
newWindow.maximize()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (fullScreen) {
|
||||||
|
newWindow.setFullScreen(true)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// If called multiple times
|
// If called multiple times
|
||||||
|
@ -322,7 +327,8 @@ function runApp() {
|
||||||
|
|
||||||
const value = {
|
const value = {
|
||||||
...newWindow.getNormalBounds(),
|
...newWindow.getNormalBounds(),
|
||||||
maximized: newWindow.isMaximized()
|
maximized: newWindow.isMaximized(),
|
||||||
|
fullScreen: newWindow.isFullScreen()
|
||||||
}
|
}
|
||||||
|
|
||||||
await baseHandlers.settings._updateBounds(value)
|
await baseHandlers.settings._updateBounds(value)
|
||||||
|
|
Loading…
Reference in New Issue