AltF02 / x11-rs

Rust bindings for X11 libraries
https://docs.rs/x11
MIT License
204 stars 66 forks source link

Missing constant `None`? #167

Closed dagit closed 1 year ago

dagit commented 1 year ago

As far as I can tell, the constant None (defined in X.h as 0L) is missing from this library.

I discovered this the hard way when I was trying to use GLX_NONE in a call to x11::glx::glXChooseVisual and getting mysterious behavior.

Reddit thread for context: https://www.reddit.com/r/rust/comments/10eprrk/what_is_the_difference_between_this_rust_code_and/

anko commented 1 year ago

Duplicate of https://github.com/AltF02/x11-rs/issues/53? (I commented there, to keep discussion in one place.)

dagit commented 1 year ago

Duplicate of #53?

Yes. Sorry about that. I searched for issues related to None but I missed it.

I get the issue with conflicting with option::None but maybe it could be named XNone and the docs could just say "this is the same as X.h None and has a value of 0"? Or something like that. Now that I know to be careful about GLX_NONE vs None, I doubt it will come up again for me. I'm mostly just annoyed I wasted half a day before isolating the error and I would love to see some sort of change so that no one else shares that experience.

AltF02 commented 1 year ago

I'm closing this in favor of #53, I've reopened the issue. Lets move discussion there