[Xcb] [xpyb] SendEvent considered unusable
Julien Danjou
julien at danjou.info
Thu Feb 4 05:27:49 PST 2010
Hi,
I've played with SendEvent today. It seems totally unusable as it is.
For people not knowing xpyb, here is how it is defined:
def SendEvent(self, propagate, destination, event_mask, event):
...
buf.write(str(buffer(array('b', event))))
...
Meaning event has to be a buffer actually. I had to write:
buf = struct.pack("BB2xIIII12x",
33, # XCB_CLIENT_MESSAGE
32, self.xid, Atom("WM_PROTOCOLS").value,
Atom("WM_TAKE_FOCUS").value,
xcb.xproto.Time.CurrentTime)
To send a message, because you cannot instanciante a
ClientMessageEvent without having a buffer to initialize it, anyway.
We also miss the opcode of events (like XCB_CLIENT_MESSAGE is 33).
Eamon, do you think there is something we could do about that?
I agree the generated code is correct, but that seems totally
unusable to me.
PS: I already have been bitten by GetProperty returning
xcb.List of Byte being a PITA to convert myself, and now that,
it is too much for me. :-)
Cheers,
--
Julien Danjou
// ᐰ <julien at danjou.info> http://julien.danjou.info
// Life is life. Lalalalala.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
Url : http://lists.freedesktop.org/archives/xcb/attachments/20100204/e80b2c1b/attachment.pgp
More information about the Xcb
mailing list