fix canvas issue when gpu is disabled
This commit is contained in:
parent
6061995605
commit
97ab1a7b15
4 changed files with 10 additions and 2 deletions
|
|
@ -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
|
||||
`)
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue