Closed microo8 closed 2 years ago
So I changed it to load libX11 only once when calling a function. Tests are ok.
Thanks, I'll merge it first and then dig more about this. After a quick inspection on the Go's plugin package, it turns out they are the exact same appraoch.
Thanks! It's always a great feeling when some of my work is merged. Now I'll try to find out how to wayland :)
Removing linking of libX11 and replacing it with dlopen to call the functions dynamically. For the future wayland support, the library will not require the libX11 library to be installed on the running system. For compiling it we need it, because of the huge and complicated type definitions, but the compiled binary will run also on a system without libX11.
Maybe in the future we can eliminate also the
X11/Xlib.h
andX11/Xatom.h
. The only thing that really needs to be declared is theXEvent
and it's attributes, other things can be avoid
pointer or some c primitives.