mirror of
https://github.com/FreeTubeApp/FreeTube
synced 2024-11-22 01:45:40 +01:00
Merge cf9d7c70b7
into a70a5c6ab2
This commit is contained in:
commit
0dcf53348b
@ -626,6 +626,8 @@ function runApp() {
|
||||
}
|
||||
}
|
||||
|
||||
const htmlFullscreenWindowIds = new Set()
|
||||
|
||||
async function createWindow(
|
||||
{
|
||||
replaceMainWindow = true,
|
||||
@ -801,7 +803,18 @@ function runApp() {
|
||||
}
|
||||
})
|
||||
|
||||
newWindow.on('enter-html-full-screen', () => {
|
||||
htmlFullscreenWindowIds.add(newWindow.id)
|
||||
})
|
||||
|
||||
newWindow.on('leave-html-full-screen', () => {
|
||||
htmlFullscreenWindowIds.delete(newWindow.id)
|
||||
})
|
||||
|
||||
newWindow.once('close', async () => {
|
||||
// returns true if the element existed in the set
|
||||
const htmlFullscreen = htmlFullscreenWindowIds.delete(newWindow.id)
|
||||
|
||||
if (BrowserWindow.getAllWindows().length !== 1) {
|
||||
return
|
||||
}
|
||||
@ -809,7 +822,9 @@ function runApp() {
|
||||
const value = {
|
||||
...newWindow.getNormalBounds(),
|
||||
maximized: newWindow.isMaximized(),
|
||||
fullScreen: newWindow.isFullScreen()
|
||||
|
||||
// Don't save the full screen state if it was triggered by an HTML API e.g. the video player
|
||||
fullScreen: newWindow.isFullScreen() && !htmlFullscreen
|
||||
}
|
||||
|
||||
await baseHandlers.settings._updateBounds(value)
|
||||
|
Loading…
Reference in New Issue
Block a user