1

例外を発生させない次のコードがありますが、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 でテストしています。

私は何か間違ったことをしていますか?もしそうなら、どうすれば修正できますか?

4

1 に答える 1

3

編集:問題はパラメーターの数が正しくありません: xproto.CW.EventMask1つの値があり、2つを渡す必要があることを示し[xproto.EventMask.SubstructureRedirect, xproto.EventMask.SubstructureNotify]ます[xproto.EventMask.SubstructureRedirect|xproto.EventMask.SubstructureNotify]

import xcb
import xcb.xproto as xproto
conn = xcb.connect()
root = conn.get_setup().roots[0].root
conn.core.ChangeWindowAttributesChecked(self.root, xproto.CW.EventMask, [xproto.EventMask.SubstructureRedirect|xproto.EventMask.SubstructureNotify])
while True:
    e = conn.wait_for_event()
    print e
于 2012-08-14T23:48:33.257 に答える