Conversation
There has been a breaking API change in raw-window-handle. The traits HasRawDisplayHandle and HasRawWindowHandle have been deprecated in favor of the new HasDisplayHandle and HasWindowHandle traits. Instead of a raw handle, a handle containing a lifetime is handed out via these traits. Internally, we still use the raw API and convert to the new handles. Signed-off-by: Uli Schlachter <psychon@znc.in>
| handle.connection = self.get_raw_xcb_connection(); | ||
| fn display_handle(&self) -> Result<DisplayHandle<'_>, HandleError> { | ||
| // We do not have/know a screen, but people want this trait implemented anyway. We guess. | ||
| let screen = 0; |
There was a problem hiding this comment.
I'm not sure how correct how correct this is. I believe we should have something like:
struct XCBConnectionAndScreen<T: AsRef<XCBConnection>> {
connection: T,
screen: usize,
}
impl<T: AsRef<XCBConnection>> HasDisplayHandle for XCBConnectionAndScreen<T> {
...
}There was a problem hiding this comment.
Yeah, I do not know that either. But for this PR: It is as correct as the old implementation. Previously, the screen = 0 was just hidden in a call to XcbDisplayHandle::empty(): https://docs.rs/raw-window-handle/0.5.2/src/raw_window_handle/unix.rs.html#191-196
Edit:
I believe we should have something like:
If you want, I can add a struct like that, but I would do that separately and not together with the version bump.
There was a problem hiding this comment.
In #772 (comment) a similar question was answered with:
The raw-window-handle spec says that it is up to the consumer of the handle to fill these fields in if they need them.
I'm not quite sure what this refers to... 🤷
There was a problem hiding this comment.
Yeah, I do not know that either. But for this PR: It is as correct as the old implementation. Previously, the
screen = 0was just hidden in a call toXcbDisplayHandle::empty(): https://docs.rs/raw-window-handle/0.5.2/src/raw_window_handle/unix.rs.html#191-196
Then I guess we can leave this as-is
There has been a breaking API change in raw-window-handle. The traits HasRawDisplayHandle and HasRawWindowHandle have been deprecated in favor of the new HasDisplayHandle and HasWindowHandle traits. Instead of a raw handle, a handle containing a lifetime is handed out via these traits. Internally, we still use the raw API and convert to the new handles.