[2020/12/23]如何解决electron窗口圆角问题
Tofloor
poster avatar
司南
deepin
2020-12-24 06:46
Author

如下图所示,electron设置好圆角后,但是四个角居然变成不透明的黑色。请问如何解决呢?

main.js:
frame: false transparent:true index.html中已经设置好body透明 终端执行:electron . --enable-transparent-visuals --disable-gpu



Reply Favorite View the author
All Replies
SamLukeYes
deepin
2020-12-24 06:56
#1

参考一下这个 issue

Reply View the author
司南
deepin
2020-12-24 07:07
#2
SamLukeYes

参考一下这个 issue

最新的留言和我的情况一样,都是有黑色边框

Reply View the author
cgp
deepin
2020-12-24 19:12
#3

这个确实是electron的bug,electron官方又将锅甩给了显卡。

可以参考下面的解决办法:

将electron的main.js中的创建主窗口延时一下即可解决

app.on('ready', createWindow)

改为:

app.on('ready', () => {
setTimeout(() => {
createWindow() //解决Linux下背景无法透明问题
},100)
})


Reply View the author