检测 Gnome 中更改的工作空间

发布于 2024-08-03 22:58:56 字数 301 浏览 3 评论 0原文

我试图弄清楚如何检测当前用户何时更改了 Mono 中的工作区。我什至不太确定 Gnome 的工作空间方面是如何运作的。简单浏览一下 Monodoc 并没有发现任何结果,而且我也找不到能够提供我想要的内容的 GConf 密钥。

更新: 仅当 Compiz 未设置虚拟大小时,以下方法才有效。例如,如果您将 Compiz 中的桌面数量设置为 1,水平虚拟大小为 2,则 Gdk.Global.CurrentDesktop 将为两个工作区返回 0。

那么有谁知道在 Compiz 启用虚拟桌面时查找工作空间是否已更改的方法吗?

I'm trying to figure out how to detect when the current user has changed their workspace in Mono. I'm not even really sure how the workspace aspect of Gnome operates. A brief look through Monodoc didn't turn anything up, and I couldn't locate a GConf key that gave me what I wanted either.

Update:
The method below will ONLY work if Compiz is not set to have a virtual size. For instance, if you set the number of desktops in Compiz to 1 with a horizontal virtual size of 2, Gdk.Global.CurrentDesktop will return 0 for both workspaces.

So does anyone know of a method for finding if the workspace has been changed when Compiz has virtual desktops enabled?

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

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

发布评论

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

评论(2

但可醉心 2024-08-10 22:58:56

这实际上是窗口管理器的一个功能,其具体工作方式因窗口管理器而异。我不熟悉如何在 Mono 中访问 xlib,但您正在寻找 _NET_NUMBER_OF_DESKTOPS_NET_DESKTOP_NAMES_NET_CURRENT_DESKTOP 等。 X根窗口上的属性。

FreeDesktop.org 的扩展窗口管理器提示规范包含许多细节。

This is actually a feature of the window manager, and how exactly it works varies between window managers. I'm not familiar with how to access xlib in Mono, but you're looking for the _NET_NUMBER_OF_DESKTOPS, _NET_DESKTOP_NAMES, _NET_CURRENT_DESKTOP, etc. X properties on the root window.

FreeDesktop.org's Extended Window Manager Hints specification contains many of the details.

み格子的夏天 2024-08-10 22:58:56

使用 libwnck。我很确定有一个 Mono 包装器。

Use libwnck. I am pretty sure there is a Mono wrapper for it.

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