查找 X 窗口管理器的名称 [英] Find the name of the X window manager

查看:29
本文介绍了查找 X 窗口管理器的名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何从程序中找到正在运行的 X 窗口管理器的名称?

How do I find the name of the running X window window manager from a program?

如果我在另一个窗口管理器已经运行时启动另一个窗口管理器,则会发生错误,因此另一个窗口管理器必须有办法检测到第一个.

If I start another window manager when one is already running, then an error occurs, so there must be a way for the other window manager to detect the first one.

它是如何工作的?

推荐答案

EWMH 规范,兼容的窗口管理器会将根窗口上的 _NET_SUPPORTING_WM_CHECK 属性设置为窗口 ID.

By the EWMH spec, a compliant window manager will set the _NET_SUPPORTING_WM_CHECK property on the root window to a window ID.

如果 _NET_SUPPORTING_WM_CHECK 属性存在并且包含现有窗口的 ID,那么符合 ICCCM2.0 的窗口管理器正在运行.如果该属性存在但不包含现有窗口的 ID,则符合 ICCCM2.0 的窗口管理器在未进行适当清理的情况下退出.如果该属性不存在,则没有符合 ICCCM2.0 的窗口管理器正在运行.

If the _NET_SUPPORTING_WM_CHECK property exists and contains the ID of an existing window, then a ICCCM2.0-compliant window manager is running. If the property exists but does not contain the ID of an existing window, then a ICCCM2.0-compliant window manager exited without proper cleanup. If the property does not exist, then no ICCCM2.0-compliant window manager is running.

那个窗口(不是根窗口,而是根窗口上的一个属性描述的那个)应该有一个 _NET_WM_NAME 属性,这就是你寻找.

That window (not the root window, but the one described by a property on the root window) should have a _NET_WM_NAME property on it, which is what you are looking for.

这篇关于查找 X 窗口管理器的名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆