Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

窗口层级 #42

Open
zyxiaofeng opened this issue Jun 30, 2020 · 7 comments
Open

窗口层级 #42

zyxiaofeng opened this issue Jun 30, 2020 · 7 comments

Comments

@zyxiaofeng
Copy link

您好,请问窗口置顶应该如何修改,我尝试文档中setAlwaysOnTop,发现在运行游戏后,比如LOL,窗口会失去最顶层的位置

@stevenjoezhang
Copy link
Member

您好,可以看下 Electron 的官方文档
https://www.electronjs.org/docs/api/browser-window#winsetalwaysontopflag-level-relativelevel

setAlwaysOnTop 的最高等级是 screen-saver,理论上和屏保一样,能够让窗口处于任何其它程序之上。
不过不同的操作系统可能略有不同,这个我还没具体测试。

@zyxiaofeng
Copy link
Author

嗯嗯,我现在在尝试使用window的做这个操作

@zyxiaofeng
Copy link
Author

您好,我设置了screen-saver后,层级比原来高了,但是依然没有游戏的层级高

@stevenjoezhang
Copy link
Member

好的,谢谢反馈,我测试一下看有没有别的办法

@zyxiaofeng
Copy link
Author

好的,期待您的回复,正在寻找一个可以在游戏窗口层级之上的方法

@stevenjoezhang
Copy link
Member

stevenjoezhang commented Jul 5, 2020

测试了一下,PowerPoint 的全屏和一些游戏的全屏是不一样的状态,有点复杂。等我有时间会把现有的逻辑修改一下~

只用 electron 似乎实现不了。见 electron/electron#10078 https://github.com/hiitiger/gelectron

@Lylisfare
Copy link

wps的演示文稿,把层级设置为 "screen" 可以解决置顶问题,ms的PowerPoint还没测试过

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants