电子:在所有其他窗口(甚至全屏)上创建一个窗口并隐藏任务栏 [英] Electron : Create a window above all the others (even fullscreen) and hide taskbar

查看:93
本文介绍了电子:在所有其他窗口(甚至全屏)上创建一个窗口并隐藏任务栏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于我的问题的标题可能是充分可以理解的,我还是会解释的。

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,aso。)等程序之上,因为它们通常会操纵图形渲染,以便你无法掌握它们。

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.

希望这会有所帮助!

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

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆