[Xcb] Problem with xpyb and setCrtcConfig()
Alberto Milone
albertomilone at gmail.com
Tue Nov 4 07:27:36 PST 2008
On Monday 03 November 2008 18:51:02 you wrote:
> Alberto Milone wrote:
> > 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))
>
> The C binding needs a length or count for the last parameter, since C
> does not know how long a list is. I'm guessing (guessing, mind you,
> since I don't actually know anything about the python binding) that the
> python binding author decided to follow the XCB C binding implementation
> as closely as possible, and you need to put in a redundant length or
> count somewhere.
>
> See also PolyPoint (and etc), as I mentioned previously.
>
Problem solved.
<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" />
<pad bytes="20" />
</reply>
</request>
I had to set padding to 20 in the reply.
However I think I've found a problem with rotations. If I create an object of
the xcb.randr.Rotation class I get correct values assigned to these
attributes:
rot = xcb.randr.Rotation()
Rotate_0 == 1
Rotate_90 == 2
Rotate_180 == 4
Rotate_270 == 8
Reflect_X == 16
Reflect_Y == 32
However if I try to set the rotation I can only use Rotate_0 and Rotate_180
(whose values are 1 and 4). I have also noticed that passing the following
values I get the following results:
17 -> Reflect_Y
20 -> Reflect_X and Reflect_Y (at the same time)
33 -> same a s 20
36 -> same as 17
49 -> Rotate_180
52-> Rotate_0
crtc.rotations is 63
Any ideas on what's happening or on how to debug the problem?
Thanks again
Alberto Milone
More information about the Xcb
mailing list