I have this code that does not give any exception, but I do not seem to be receiving events like MapRequests, or 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
I am testing this in Xephyr.
Am I doing something wrong? And if so, how do I fix it?
edit:
the problem is in incorrect number of parameters: xproto.CW.EventMask
indicates that you have one value and you are passing two as [xproto.EventMask.SubstructureRedirect, xproto.EventMask.SubstructureNotify]
which should be [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