raw-window-handle icon indicating copy to clipboard operation
raw-window-handle copied to clipboard

Should X display/connection handles be nullable?

Open madsmtm opened this issue 2 years ago • 3 comments

XlibDisplayHandle.display and XcbDisplayHandle.connection are nullable; should they be?

Previously discussed in https://github.com/rust-windowing/raw-window-handle/pull/136.

madsmtm avatar Aug 24 '23 00:08 madsmtm

If I remember correctly, display handles can be null for EGL. I've changed my mind since my posts in #136, I think allowing this use case is worth it.

notgull avatar Aug 24 '23 00:08 notgull

Yes, there's a thing called EGL_DEFAULT_DISPLAY, so it'll use the display somehow automatically. Also it does open connection under the hood with xcb iirc the mesa code.

kchibisov avatar Aug 25 '23 19:08 kchibisov

Whether null is correct depends on the context. Like kchibisov, for EGL it is valid. Meanwhile in Vulkan, you must provide a valid pointer to a display.

i509VCB avatar Nov 11 '23 05:11 i509VCB

Closing now, as I think this question was answered.

notgull avatar Jun 22 '24 16:06 notgull