[Xcb] Problem with xpyb and setCrtcConfig()

Alberto Milone albertomilone at gmail.com
Mon Nov 3 08:24:26 PST 2008


On Monday 03 November 2008 16:48:03 you wrote:
> Alberto Milone wrote:
> > On Friday 31 October 2008 17:52:28 you wrote:
> >> Upon closer inspection, it takes two lists of XIDs, not one. Ugh. That
> >> might be difficult to describe well in the XML.
> >
> > Why two lists? I see only this:
> > outputs: LISTofOUTPUT
>
> My mistake. I confused myself when looking at the server side
> implementation. One list is correct.
>
> > I have modified randr.xml as follows:
> >
> > 	<xidtype name="RROutput" />
> >
> > 	<request name="SetCrtcConfig" opcode="21">
> > 		<field type="CARD32" name="crtc" />
> > 		<field type="TIMESTAMP" name="timestamp" />
> > 		<field type="TIMESTAMP" name="config_timestamp" />
> > 		<field type="INT16" name="x" />
> > 		<field type="INT16" name="y" />
> > 		<field type="CARD32" name="mode" />
> > 		<field type="CARD16" name="rotation" />		<!-- enum Rotation -->
>
>  <pad bytes="2" />
>  <list type="RROutput" name="outputs" />
>
> > 		<reply>
> > 			<field type="CARD8" name="status" />	<!-- enum SetConfig -->
> > 			<field type="TIMESTAMP" name="timestamp" />
> > 		</reply>
> > 	</request>
> >
> > but I'm still getting this error:
> >  File "xrandr-proto.py", line 640, in rr_crtc_set_config
> >     result = cookie.reply()
> > xcb.xproto.BadMatch: <xcb.xproto.MatchError object at 0x875a98c>
> >
> > Is there anything I'm missing?
>
> Two padding bytes, and the fact that the length of the list is implicit
> (similar to xproto PolyPoint/PolyLine/etc), as far as I can see.
>
> For bonus points, you can also modify the rest of the randr requests
> that use an RROutput to use your new xidtype instead of CARD32 where
> appropriate.
>
> Peter Harris

Now it says that "SetCrtcConfig" takes exactly 10 arguments (9 given).

But I guess it should take 9 arguments:
cookie = self.conn.randr.SetCrtcConfig(crtc.id, crtc.timestamp, 
resources.config_timestamp, x, y, mode.id, rotation, map(lambda n: 
n.id, outputs))

Also what's the function of padding bytes?

Alberto


More information about the Xcb mailing list