[英]How to monitor active window changes using xcb?
I'm trying to find a way to monitor when the _NET_ACTIVE_WINDOW
property changes.我正在尝试找到一种方法来监视
_NET_ACTIVE_WINDOW
属性何时更改。 Right now I'm polling every 1 second to update the current active window.现在我每 1 秒轮询一次以更新当前活动的 window。 I know that there's a way to get events about this, I've seen references to it, but I can't seem to find any code (that I can understand) that explains how to do it.
我知道有一种方法可以获取有关此的事件,我已经看到了对它的引用,但我似乎找不到任何代码(我可以理解)来解释如何做到这一点。
If you set PropertyChange
mask on root window you'll start getting PropertyNotify
events to your code.如果您在根 window 上设置
PropertyChange
掩码,您将开始将PropertyNotify
事件发送到您的代码。 See example in my answer here: Linux get notification on focused gui window change请参阅此处我的答案中的示例: Linux 获得有关重点 gui window 更改的通知
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.