[Xcb] Fwd: Problem with XCB Python and RandR

Alberto Milone albertomilone at gmail.com
Mon Oct 20 10:15:22 PDT 2008


On Monday 20 October 2008 17:22:08 you wrote:
> Eamon Walsh wrote:
> From the auto-generated randr.py:
>
>     def GetCrtcInfo(self, crtc, config_timestamp):
>         buf = cStringIO.StringIO()
>         buf.write(pack('xx2xII', crtc, config_timestamp))
>         return self.send_request(xcb.Request(buf.getvalue(), 20, False,
> True), GetCrtcInfoCookie(),
>                                  GetCrtcInfoReply)
>
>
> So GetCrtcInfo takes two arguments and they are both 4-byte unsigned
> (CARD32, "I" in pack() parlance) values.  What is their significance?
> Beats me, xpyb is just a binding.  Looks like one of them is an index
> and one is a standard X11 timestamp.
>
> Also from randr.py:
>
> class GetCrtcInfoReply(xcb.Reply):
>     def __init__(self, parent):
>         xcb.Reply.__init__(self, parent)
>         count = 0
>         (self.status, self.timestamp, self.crtc, self.x, self.y,
> self.width, sel f.height, self.mode, self.rotation, self.rotations,
> self.num_outputs, self.num_p ossible_outputs,) =
> unpack_from('xB2x4xIIhhHHIHHHH', self, count)
>         count += 36
>         self.outputs = xcb.List(self, count, self.num_outputs, 'I', 4)
>
>
> So the reply is a bunch of structure fields and then a list of CARD32.
> The question is whether this accurately matches what is on the wire.
>
> There was a bug in xpyb 0.9 where it didn't work properly on 64-bit
> systems and the "buffer object too short" error would be thrown, but
> that's supposedly fixed in 1.0.

I have tried to override the check in xpybList_init() in list.c (only for 
testing):
/*if (length * size + offset > datalen) {
	PyErr_SetString(xpybExcept_base, "Protocol object buffer too short.");
	return -1;
    }*/

I can get the crtcinfo however one of its struct members (or object 
attributes) doesn't seem to be right. I'm referring to crtcinfo.mode which is 
an int equal to 4128769 but (as far as I know) it should be either an RRMode 
object or (if it's meant to be a an integer) a mode id but it's too big and 
doesn't match any of the available modes.

Other than this xpyb is great and I'm using it to write Python bindings for 
RandR.

If you need further information to investigate this problem, please let me 
know.

Regards,

Alberto Milone


More information about the Xcb mailing list