ios: attempt to fix rendering glitch when waking up after sleep

This commit is contained in:
jean-emmanuel 2022-10-22 18:58:13 +02:00
parent 782491282c
commit 7ffe125623
2 changed files with 17 additions and 0 deletions

View file

@ -41,6 +41,22 @@ if (iOS && !iOS13) {
}
if (iOS) {
// when waking from sleep, iOS may have trouble rendering the session properly
// this attempts to force a full redraw by shortly resizing the main container
document.onvisibilitychange = ()=>{
if (document.visibilityState === 'visible') {
var main = DOM.get('osc-panel-container#main')[0]
main.style.marginBottom = '1px'
main.style.marginRight = '1px'
setTimeout(()=>{
main.style.marginBottom = ''
main.style.marginRight = ''
})
}
}
}
if (iOS13) document.body.classList.add('iOS13')
module.exports = iOS