Hi everyone,

I'm new to xlib and found the following error:

X protocol error:
<class 'Xlib.error.BadAccess'>: code = 10, resource_id = 94, sequence_number = 7, major_opcode = 2, minor_opcode = 0

It occurred within the next block of code:

from Xlib import X, display

dpy = display.Display()
root = dpy.screen().root
root.change_attributes(event_mask = X.ButtonPressMask)

while 1:
    event = dpy.next_event()
    if event.type == X.ButtonPress:
        print 'button pressed'

It doesn't occur if I replace X.ButtonPessMask and X.ButtonPress by X.ButtonReleaseMask and X.ButtonRelease

I wonder whether it's a bug in python-xlibs or something I don't know about the X protocol,

thanks in advance,