【发布时间】:2012-08-13 15:56:18
【问题描述】:
我有这段代码没有给出任何异常,但我似乎没有收到像 MapRequests 或 ConfigureNotifys 这样的事件:
import xcb
import xcb.xproto as xproto
conn = xcb.connect()
root = conn.get_setup().roots[0].root
eventmask = [xproto.EventMask.SubstructureRedirect, xproto.EventMask.SubstructureNotify]
conn.core.ChangeWindowAttributesChecked(self.root, xproto.CW.EventMask, eventmask)
while True:
e = conn.wait_for_event()
print e
我正在 Xephyr 中对此进行测试。
我做错了吗?如果是这样,我该如何解决?
【问题讨论】:
-
您能发布最少的可重现代码吗?在我看来还可以。服务器是否发回任何错误?请注意,只允许一个客户端设置给定窗口的 SubstructureRedirect 掩码,如果您仍然运行窗口管理器,它可能拥有该掩码。
-
@AndreySidorov 我还没有检查错误,但我会的。当我在交互式解释器中尝试它时,它返回了一个 void cookie。
-
ChangeWindowAttributes 请求不返回数据(因此 cookie 无效),但可能导致错误。