-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use raw-window-handle version 0.6 #132
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implemented Web, built on top of forkgull/winit#1 now, until that's merged.
We should probably add feature flags for raw-window-handle versions, like in rust-windowing/winit#3126. Edit: Though I guess it's a bit harder to do with adaptive features for arguments. Without some trait magic. If we can support both 0.5 and 0.6 in a clean way, that would be good though. |
Actually, I guess we can't have a function that accepts either something implementing both Anyway, if it's going to support only 0.6, it should be released alongside the Winit version that adds support for 0.6. |
Signed-off-by: John Nunley <dev@notgull.net> Co-Authored-By: dAxpeDDa <daxpedda@gmail.com>
Signed-off-by: John Nunley <dev@notgull.net>
fc19d27
to
1f44e3a
Compare
Signed-off-by: John Nunley <dev@notgull.net>
Signed-off-by: John Nunley <dev@notgull.net>
CI seems to be failing because the benchmark fails to build. So that also needs to be updated. |
Signed-off-by: John Nunley <dev@notgull.net>
pub struct WaylandDisplayImpl { | ||
conn: Connection, | ||
pub struct WaylandDisplayImpl<D: ?Sized> { | ||
conn: Option<Connection>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of using an Option
, I'd probably just rely on field order, and have a safety comment indicating this requirement.
There's also ManuallyDrop
, though the docs for it seem to just recommend using field order for this sort of thing instead of dealing with it: https://doc.rust-lang.org/std/mem/struct.ManuallyDrop.html#manuallydrop-and-drop-order
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather rely on Option
than unsafe ManuallyDrop
or fragile field ordering.
pub unsafe fn new(display_handle: WaylandDisplayHandle) -> Result<Self, SoftBufferError> { | ||
// SAFETY: Ensured by user | ||
let backend = unsafe { Backend::from_foreign_display(display_handle.display as *mut _) }; | ||
impl<D: HasDisplayHandle + ?Sized> WaylandDisplayImpl<D> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why ?Sized
? It wouldn't actually be possible to call new
with a display: D
is D
isn't Sized
, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This way it allows for Context<D>
to be coerced into Context<dyn HasDisplayHandle>
, and be used like that.
@@ -1,3 +1,5 @@ | |||
// TODO: Once winit is updated again, restore this test. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Winit is released, so presumably this can be updated. Though https://github.com/notgull/winit-test will need a release.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
…Close` again It seems rust-windowing#132 included a copy-paste typo to trigger draw logic on `CloseRequested` instead of on `RedrawRequested`. Signed-off-by: Marijn Suijten <marijns95@gmail.com>
…Close` again It seems rust-windowing#132 contains a copy-paste typo to trigger draw logic on `CloseRequested` instead of on `RedrawRequested`. Signed-off-by: Marijn Suijten <marijns95@gmail.com>
…Close` again It seems #132 contains a copy-paste typo to trigger draw logic on `CloseRequested` instead of on `RedrawRequested`. Signed-off-by: Marijn Suijten <marijns95@gmail.com>
cc rust-windowing/raw-window-handle#125, rust-windowing/winit#2943
Testing out the new release before it becomes official.