Skip to content

Commit

Permalink
enable hw accel, try setBackgroundColor after loading page
Browse files Browse the repository at this point in the history
  • Loading branch information
Galkon committed Nov 13, 2023
1 parent 098a6e0 commit 2ba372b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ const createWindow = async () => {
* @returns {Promise<void>}
*/
const start = async () => {
app.disableHardwareAcceleration()
// app.disableHardwareAcceleration()

await app.whenReady()
let window = await createWindow()
Expand Down Expand Up @@ -157,16 +157,16 @@ const start = async () => {
overlay.setBounds({x, y, width, height})
}

if (props.setBackgroundColor) {
overlay.setBackgroundColor(props.backgroundColor ?? '#00000000')
}

const overlayHtml = isDevelopment
? path.join(__dirname, 'src', 'renderer', 'overlay.html')
: path.join(__dirname, 'overlay.html')

await overlay.loadURL(`file://${overlayHtml}`)

if (props.setBackgroundColor) {
overlay.setBackgroundColor(props.backgroundColor ?? '#00000000')
}

event.reply('overlay-opened', {
name: props.name,
x,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "electron-overlay-test",
"productName": "Electron Overlay Test",
"version": "1.0.1",
"version": "1.0.2",
"description": "Test electron overlay with transparent windows.",
"main": "main.js",
"scripts": {
Expand Down

0 comments on commit 2ba372b

Please sign in to comment.