最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How to make Electron in a window on top of all other Windows as an indicator of Skype - Stack Overflow

programmeradmin0浏览0评论

Help to make the same window, as with Skype when we call, we see window with call info, via Electron. The point is that this window is always on top of all Windows on your puter, including games.

The alwaysOnTop parameter: true sets the window in front of all other Windows, but the game covers it in full-screen mode.

Is it possible and how it can be implemented in the Electron or in what ways it can be done?

Help to make the same window, as with Skype when we call, we see window with call info, via Electron. The point is that this window is always on top of all Windows on your puter, including games.

The alwaysOnTop parameter: true sets the window in front of all other Windows, but the game covers it in full-screen mode.

Is it possible and how it can be implemented in the Electron or in what ways it can be done?

Share Improve this question edited Mar 12, 2018 at 11:07 mmvsbg 3,58817 gold badges54 silver badges74 bronze badges asked Mar 12, 2018 at 9:39 ГлебГлеб 211 gold badge1 silver badge2 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 4

On macOS, it is possible to set the window to be always on top with more options by using the BrowserWindow instance method win.setAlwaysOnTop() instead of the alwaysOnTop flag:

win.setAlwaysOnTop(flag[, level][, relativeLevel])

Values include normal, floating, torn-off-menu, modal-panel, main-menu, status, pop-up-menu, screen-saver, and dock (Deprecated). The default is floating.

You may want to try all possible level values to get the one which may fit your needs.

Setting window.setAlwaysOnTop(true, "normal") does the trick as suggested by Alok Kamboj

I was stuck on same thing and managed to make always on top work using this particular hack(in this particular order) -

// Tricky way to bring cam bubble to top over fullscreen windows on mac
  win.setVisibleOnAllWorkspaces(true, { visibleOnFullScreen: true });
  win.setAlwaysOnTop(true, "floating");
  win.setFullScreenable(false);
  // Below statement pletes the flow
  win.moveTop();

Now this used to work when I was on electron 9.3.5 and stopped working after I upgraded to 13.1.2. Now I'm able to achieve the same thing using "normal".

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论