Skip to content

Instantly share code, notes, and snippets.

@t57ser
Created June 24, 2024 12:18
Show Gist options
  • Save t57ser/ee82b7ea981e35afc9a3130c28e7e20e to your computer and use it in GitHub Desktop.
Save t57ser/ee82b7ea981e35afc9a3130c28e7e20e to your computer and use it in GitHub Desktop.
[Bug]: Using app.disableHardwareAcceleration() makes window disappear
const {app, BrowserWindow, ipcMain, WebContentsView} = require('electron')
let mainWindow
function createWindow () {
const mainWindow1 = new BrowserWindow({
x: 0,
y: 0,
width: 1000,
height: 600,
show: false,
frame: false,
transparent: true,
});
mainWindow1.loadURL("https://www.example.com").then(() => {
//mainWindow1.webContents.openDevTools();
mainWindow1.show();
})
}
app.disableHardwareAcceleration();
app.on('ready', createWindow)
app.on('window-all-closed', function () {
if (process.platform !== 'darwin') {
app.quit()
}
})
app.on('activate', function () {
if (mainWindow === null) {
createWindow()
}
})
{
"main": "main.js",
"scripts": {
"start": "electron ."
},
"devDependencies": {
"electron": "31.0.0"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment