x11
x11 copied to clipboard
fix: Xrender invalid Glyph, GlyphSet, Picture and PictFormat type
Seems wrong https://docs.rs/x11/latest/x11/xrender/constant.BadGlyph.html uses c_int and https://www.x.org/releases/X11R7.5/doc/renderproto/renderproto.txt says it's a 32 bit type.
I found it defined as XID (which is unsigned long) in the actual c header in my system (and here).
Also BadGlyph is some constant, not type Glyph.
I thought this is an error in x11 wrapper, because strange error occurred when I used x11/xrender In C code alignment of XRenderPictFormat's direct field was 16
#include <X11/extensions/Xrender.h>
#include <stdio.h>
int main() {
XRenderPictFormat x;
printf("%i", (void*)&x.direct - (void*)&x);
}
16
But in Nim
import x11/xrender
var x: XRenderPictFormat
echo cast[int](x.direct.addr) - cast[int](x.addr)
was
12