Electron:在所有其他窗口之上创建一个窗口(甚至全屏)并隐藏任务栏

Electron : Create a window above all the others (even fullscreen) and hide taskbar(Electron:在所有其他窗口之上创建一个窗口(甚至全屏)并隐藏任务栏)
本文介绍了Electron:在所有其他窗口之上创建一个窗口(甚至全屏)并隐藏任务栏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

由于我的问题的标题可能很容易理解,我还是会解释一下.

As the title of my question may be sufficiently understandable, I'll explain anyway.

我正在使用 Electron 进行个人项目,但我面临一个令人沮丧的问题:

I'm working on a personal project with Electron, and I'm facing a frustrating issue which is :

我想创建一个小窗口(50x50 像素),它会在所有其他窗口上方,即使它们是全屏的.我的意思是,即使我在 Youtube 上使用 Chrome 并进入全屏模式,我的窗口也会停留在上面.

I'd like to create a small window (50x50 px) which would be above every other window, even when those are fullscreen. I mean, even if I'm on Youtube with Chrome and I enter fullscreen, my window would stay on top of it.

基本上,我已经成功地将我的窗口置于所有其他窗口之上,一个简单的 setAlwaysOnTop(true) 就可以了.但是,Windows 中的任务栏一直显示,但如果我隐藏我的窗口或只是关闭它,任务栏就会消失,一切都很好.

Basically, I've succeeded in making my window above all the others, a simple setAlwaysOnTop(true) did the trick. However, the taskbar in Windows keeps showing, but if I hide my window or just close it, the taskbar disappears and everything's fine.

所以我的问题是:我怎样才能让一个窗口高于所有其他窗口,包括全屏窗口,这不会使任务栏可见?(在我看来,任务栏扼杀了全屏终端用户体验).

So my question is : How can I achieve to have a window above all the others, including fullscreen ones, which wouldn't make the taskbar visible ? (in my sense, the taskbar kills the fullscreen end-user experience).

详细信息:我的窗口启用了透明度,不需要信息亭模式和全屏模式,因为我只使用 50x50 像素.

Details : my window has transparency enabled, and both kiosk mode and fullscreen mode are not needed since I only use 50x50 px.

感谢您的帮助.

推荐答案

好吧,我通过这样做解决了这个问题:

Well, I fixed the issue by doing this :

window = new BrowserWindow({ ...  type:'toolbar' ... });`

当您在通话时,这使得窗口与 Skype 窗口完全一样:它始终位于顶部,即使您在全屏浏览器中并且任务栏不会显示,除非您明确关注您的窗口.

This makes the window act exactly as the Skype Window when you're on call : It's always on top, even when you're in fullscreen browser and the taskbar won't show unless you focus explicitly your window.

备注:您的窗口不会位于诸如视频游戏(英雄联盟、Dota 等)之类的程序之上,因为它们通常会操纵图形渲染,因此您无法进入它们之上.

Remark : Your window won't be on top of programs such as video games (League of Legends, Dota, aso.) because they usually manipulate the graphical rendering so that you can't go on top of em.

希望这会有所帮助!

这篇关于Electron:在所有其他窗口之上创建一个窗口(甚至全屏)并隐藏任务栏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

相关文档推荐

在开发JS过程中,会经常遇到两个小数相运算的情况,但是运算结果却与预期不同,调试一下发现计算结果竟然有那么长一串尾巴。如下图所示: 产生原因: JavaScript对小数运算会先转成二进制,运算完毕再转回十进制,过程中会有丢失,不过不是所有的小数间运算会
问题描述: 在javascript中引用js代码,然后导致反斜杠丢失,发现字符串中的所有\信息丢失。比如在js中引用input type=text onkeyup=value=value.replace(/[^\d]/g,) ,结果导致正则表达式中的\丢失。 问题原因: 该字符串含有\,javascript对字符串进行了转
Rails/Javascript: How to inject rails variables into (very) simple javascript(Rails/Javascript:如何将 rails 变量注入(非常)简单的 javascript)
CoffeeScript always returns in anonymous function(CoffeeScript 总是以匿名函数返回)
Ordinals in words javascript(javascript中的序数)
getFullYear returns year before on first day of year(getFullYear 在一年的第一天返回前一年)