【发布时间】:2021-01-03 21:49:04
【问题描述】:
tl;dr:
预期行为:
flashFrame(true) 持续闪烁,直到 flashFrame(false) 被调用。
实际行为:
flashFrame(true)只闪4次。
我的问题:
我需要在BrowserWindow() 中配置什么配置吗?
上下文:
我目前正在开发一个 ReactJS 消息传递桌面应用程序,我希望在应用程序接收到新消息并且窗口最小化时,任务栏图标会闪烁。在我在这里提出这个问题之前,我确实在互联网和Electron 文档上进行了一些搜索。我确实设法找到有人通过here 提出类似问题,但答案不是我想要实现的。
我观察到,flashFrame(true) 确实在工作,但它只闪烁了 4 次,然后才返回默认模式。我的代码如下:
if (electron) { //if it is run on Electron
if (remote.getCurrentWindow().isMinimized() === true) { //if the current window are minimized
remote.getCurrentWindow().flashFrame(true);
}
}
我需要为flashFrame(true) 进行任何配置以使其持续闪烁还是电子预期的行为?
环境:
"devDependencies": {
"electron": "latest",
"electron-builder": "latest",
}
【问题讨论】:
标签: reactjs electron electron-builder