【问题标题】:Electron's flashFrame(true) doesn't flash taskbar icon continuouslyElectron 的 flashFrame(true) 不会连续闪烁任务栏图标
【发布时间】: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


    【解决方案1】:

    它在 chromium 的代码库 https://source.chromium.org/chromium/chromium/src/+/master:ui/views/win/hwnd_message_handler.cc;l=820?q=FlashWindow&ss=chromium 中被硬编码为闪烁 4 次。

    fwi.uCount = 4;
    

    因此无法配置这是预期的行为。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2010-09-06
      • 2022-11-09
      • 2017-03-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-11-16
      相关资源
      最近更新 更多