<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Hello!<br>
<br>
As part of a first incursion into the possibility to implementing
native support for X starting from the wire protocol (w/o any
Xlib/XCB support) I ran into a couple of situations where
documentation didn't match implementation.<br>
<br>
The first surprise was the "magic" of the MIT Magic Cookie which
needs that little deviation from the protocol encoding where you
have to put the padding bytes at the end. Now I really made it to
open a window and receive key codes destined for it but no keysyms
as the request for the keyboard mappings is silently ignored. The
XKB extension as far as I understand it essentially replaced that?
But there is no addendum to core protocol specifications.<br>
<br>
The next round was about creating a circle: somehow I found out that
another map request on the window was needed to see the respective
errors due to simple mistakes during the preparation of the request
and some misleading protocol encoding which states 3+3n for the
request length.<br>
<br>
<title>Konsole output</title>
<div>
<span style="font-family:monospace"><span
style="color:#b2b2b2;background-color:#000000;">(define X
(X-connection))</span><span
style="color:#18b218;background-color:#000000;"> => </span><span
style="color:#1818b2;background-color:#000000;">#<unspecified></span><span
style="color:#000000;background-color:#ffffff;">
</span><br>
<span style="color:#b2b2b2;background-color:#000000;">(define v
(X-create-window X 50 50 300 400))</span><span
style="color:#18b218;background-color:#000000;"> => </span><span
style="color:#1818b2;background-color:#000000;">#<unspecified></span><span
style="color:#000000;background-color:#ffffff;">
</span><br>
<span style="color:#b2b2b2;background-color:#000000;">v</span><span
style="color:#18b218;background-color:#000000;"> => </span><span
style="color:#b2b2b2;background-color:#000000;">(44 #"254 255
255 3")</span><span
style="color:#000000;background-color:#ffffff;">
</span><br>
<span style="color:#b2b2b2;background-color:#000000;">(X-map-window
X (second v))</span><span
style="color:#18b218;background-color:#000000;"> => </span><span
style="color:#b2b2b2;background-color:#000000;">8</span><span
style="color:#000000;background-color:#ffffff;">
</span><br>
<span style="color:#b2b2b2;background-color:#000000;">(define g
(X-create-gc X (second v)))</span><span
style="color:#18b218;background-color:#000000;"> => </span><span
style="color:#1818b2;background-color:#000000;">#<unspecified></span><span
style="color:#000000;background-color:#ffffff;">
</span><br>
<span style="color:#b2b2b2;background-color:#000000;">g</span><span
style="color:#18b218;background-color:#000000;"> => </span><span
style="color:#b2b2b2;background-color:#000000;">(16 #"253 255
255 3")</span><span
style="color:#000000;background-color:#ffffff;">
</span><br>
<span style="color:#b2b2b2;background-color:#000000;">(X-polifill-arc
X (second v) (second g) 150 200 100 100 (* 170 64) (* 180 64))</span><span
style="color:#18b218;background-color:#000000;"> => </span><span
style="color:#b2b2b2;background-color:#000000;">24</span><span
style="color:#000000;background-color:#ffffff;">
</span><br>
<span style="color:#b2b2b2;background-color:#000000;">(X-map-window
X (second v))</span><span
style="color:#18b218;background-color:#000000;"> => </span><span
style="color:#b2b2b2;background-color:#000000;">8</span><span
style="color:#000000;background-color:#ffffff;">
</span><br>
<span style="color:#b2b2b2;background-color:#000000;">(X-control
X)</span><span style="color:#18b218;background-color:#000000;">
=> </span><span
style="color:#b2b2b2;background-color:#000000;">VSI SCA/X:
unhandled error: Length#"0 16 4 0 253 255 255 3 0 0 71 0 0</span><br>
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0"<span
style="color:#000000;background-color:#ffffff;">
</span><br>
<span style="color:#1818b2;background-color:#000000;">#<unspecified></span><br>
<span style="color:#000000;background-color:#ffffff;">
</span><br>
</span></div>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
My question is: will this continue like this? Are there any plans to
finally deliver the protocol specifications where these kinds of
interactions are layed out? Or some up to date updates on the core
protocol? But as I have heard the X server doesn't even know about
all registered extensions anymore - at least on Ubuntu with Unity
one of the first events to be received was an impossible operation
code of 192 which wasn't reported by <i>xdpyinfo</i> to belong to
any registered extension. The current state of X11 is a bit
puzzling: it when works better than ever on the hardware I know of
but it seems to become a pure C API without a valid wire protocol?<br>
<br>
<tt>(repl-transcript</tt><tt><br>
</tt><tt>(define X (X-connection))</tt><tt><br>
</tt><tt>;X</tt><tt><br>
</tt><tt>(define v (X-create-window X 50 50 300 400))</tt><tt><br>
</tt><tt>v</tt><tt><br>
</tt><tt>; (X-get-keyboard-mapping X) DEFUNCT</tt><tt><br>
</tt><tt><br>
</tt><tt>(define g (X-create-gc X (second v)))</tt><tt><br>
</tt><tt>g</tt><tt><br>
</tt><tt>(X-polifill-arc X (second v) (second g) 150 200 100 100 (*
170 64) (* 180 64))</tt><tt><br>
</tt><tt>(X-map-window X (second v)) ; We need this to see errors of
the graphic request.</tt><tt><br>
</tt><tt>(X-control X)</tt><tt><br>
</tt><tt>)</tt><tt><br>
</tt><br>
It's easy to make mistakes when implementing things on a bit and
byte level but if anyone knows the "one true sequence" to draw a
real circle that would be helpful. The FAQ mentions the Xlib
flush/sync mechanism but I wasn't able to find any correspondence in
the wire protocol and it seems to affect the xlib client buffers
only.<br>
<br>
Thanks in advance!<br>
</body>
</html>