Combine the X11 window handles into one type
notgull opened this issue · 2 comments
notgull commented
Windows in X11 are defined as "XIDs", which are unique 32-bit IDs. However, there are separate types in this crate for Xlib and XCB window handles, despite the fact that, fundamentally, they refer to the same thing.
pub struct XlibWindowHandle {
/// An Xlib `Window`.
pub window: c_ulong,
/// An Xlib visual ID, or 0 if unknown.
pub visual_id: c_ulong,
}
pub struct XcbWindowHandle {
/// An X11 `xcb_window_t`.
pub window: u32, // Based on xproto.h
/// An X11 `xcb_visualid_t`, or 0 if unknown.
pub visual_id: u32,
}
Xlib uses c_ulong
because of an extremely characteristic poor design decision, XCB gets this right. At the next breaking change, it would be nice to combine them into one type to remove any ambiguity.
kchibisov commented
They must be separate because the extensions using them are different, thus you must distinguish them somehow.
notgull commented
I see, thanks for clarifying!