x11 icon indicating copy to clipboard operation
x11 copied to clipboard

fix: Xrender invalid Glyph, GlyphSet, Picture and PictFormat type

Open levovix0 opened this issue 1 year ago • 2 comments

levovix0 avatar Feb 13 '24 20:02 levovix0

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.

Araq avatar Feb 14 '24 15:02 Araq

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

levovix0 avatar Feb 14 '24 16:02 levovix0