GTK 窗口提示

发布于 2024-09-29 03:47:16 字数 334 浏览 2 评论 0原文

我正在尝试让一个窗口覆盖整个屏幕。它的位置和尺寸都很好,但它被 Gnome 面板覆盖了。让事情变得复杂的是,我有两个显示器,这个应用程序需要支持拥有多个屏幕的人。

WINDOW_TYPE_HINT_SPLASHSCREEN 是一个好的开始。它覆盖了两个屏幕,但不覆盖面板。它仍然在那里,就在面板后面。

WINDOW_TYPE_HINT_DOCK 看起来很理想,但我需要这个窗口来获取焦点来监听键盘事件。 _DOCK 似乎是故意忽略键盘事件(这是有道理的)。我可以强制它获取键盘焦点吗?

有什么方法可以强制暗示窗口覆盖面板吗?

I'm trying to get a window to cover the whole screen. Its positioning and dimensions is fine but it gets covered by the Gnome panel. To complicate things I have two monitors and this app needs to support people with multiple screens.

WINDOW_TYPE_HINT_SPLASHSCREEN is a good start. It covers both screens but not the panel. It's still there, just behind the panel.

WINDOW_TYPE_HINT_DOCK looked ideal but I need this window to take focus to listen to a keyboard event. _DOCK seems like it purposely ignores keyboard events (which kind of makes sense). Can I force it to take keyboard focus?

Is there some way I can force a hinted window to cover the panel?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

爱要勇敢去追 2024-10-06 03:47:16

window.fullscreen() 您可以在普通的“无提示”窗口上调用它。我认为这可以让窗口管理器决定窗口是否应该覆盖面板。

There's window.fullscreen() which you can call on a normal "un-hinted" window. I assume this lets the window manager decide whether the window should cover the panel or not.

杀手六號 2024-10-06 03:47:16

如果使用 WINDOW_TYPE_HINT_MENU,则可以通过调用 gtk_window_present() 函数将焦点赋予窗口。
不过,我不知道你是否能够覆盖面板。

另一个提示:面板可能会更改其 _NET_WM_STRUT 属性,以便其他窗口无法覆盖它。也许您必须在窗口中使用这个属性(或另一个属性)。

If you use the WINDOW_TYPE_HINT_MENU, you can give the focus to the window by calling the gtk_window_present() function.
However, I don't know if you will be able to cover the panel.

Another hint: the panel probably change its _NET_WM_STRUT property so that other windows cannot cover it. Maybe you will have to play with this property (or another) in your window.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文