我的代码没有给出任何异常,但我似乎没有接收到像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测试这个。在
我做错什么了吗?如果是的话,我该怎么解决呢?在
编辑: 问题在于参数数目不正确:
xproto.CW.EventMask
表示您有一个值,而您将两个值作为[xproto.EventMask.SubstructureRedirect, xproto.EventMask.SubstructureNotify]
传递,这应该是[xproto.EventMask.SubstructureRedirect|xproto.EventMask.SubstructureNotify]
相关问题 更多 >
编程相关推荐