fix canvas issue when gpu is disabled

This commit is contained in:
bordun 2020-03-15 23:45:27 +01:00
parent 7803b6d737
commit 1be0ec296d
4 changed files with 10 additions and 2 deletions

View file

@ -1,6 +1,7 @@
var path = require('path'),
{BrowserWindow, dialog, shell, screen} = require('electron'),
shortcut = require('electron-localshortcut'),
app = require('./electron-app'),
settings = require('./settings'),
theme = require('./theme'),
screenSize = screen.getPrimaryDisplay().size
@ -28,12 +29,17 @@ module.exports = function(options={}) {
window.once('ready-to-show', ()=>{
window.show()
})
window.webContents.once('page-title-updated', ()=>{
if (options.fullscreen) {
window.webContents.sendInputEvent({keyCode: 'F11', type: 'keyDown'})
}
if (app._noGpu) {
window.webContents.executeJavaScript(`
window.ELECTRON_NOGPU = true
`)
}
})