未验证 提交 08626302 编写于 作者: J Jim 提交者: GitHub

Merge pull request #3221 from jtopper/20200727_no_really_always_on_top

UI: Make macOS 'always on top' more aggressive
......@@ -148,10 +148,18 @@ void SetAlwaysOnTop(QWidget *window, bool enable)
{
Qt::WindowFlags flags = window->windowFlags();
if (enable)
if (enable) {
/* Force the level of the window high so it sits on top of
* full-screen applications like Keynote */
NSView *nsv = (__bridge NSView *)reinterpret_cast<void *>(
window->winId());
NSWindow *nsw = nsv.window;
[nsw setLevel:1024];
flags |= Qt::WindowStaysOnTopHint;
else
} else {
flags &= ~Qt::WindowStaysOnTopHint;
}
window->setWindowFlags(flags);
window->show();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册