ios: attempt to fix rendering glitch when waking up after sleep
This commit is contained in:
parent
782491282c
commit
7ffe125623
2 changed files with 17 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue