检测 Gnome 中更改的工作空间
我试图弄清楚如何检测当前用户何时更改了 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这实际上是窗口管理器的一个功能,其具体工作方式因窗口管理器而异。我不熟悉如何在 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.
使用 libwnck。我很确定有一个 Mono 包装器。
Use libwnck. I am pretty sure there is a Mono wrapper for it.