Skip to content
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

docs: Improve documentation for safe window handles #114

Closed
wants to merge 1 commit into from

Conversation

notgull
Copy link
Member

@notgull notgull commented Mar 20, 2023

Improves documentation for the new types and traits in the borrowed.rs file.

I did some research into Android lifecycles, so I'm pretty sure now that the Active trick works and why it does. I also add notes on window ID invalidation to the window handle part.

cc #111

Comment on lines +40 to +44
/// The `Active` struct works around this by providing a borrow-checker enforced guarantee that the
/// application is not suspended. This takes advantage of the fact that he current callback-based event
/// loop setup for [`winit`], [`sdl2`] and other event loop systems to my knowledge requires an
/// `&mut self` reference to the event loop. This means that it is not possible to borrow the event loop
/// and poll for events at the same.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, realized this may not work with Window implementing HasDisplayHandle. Might need to rethink either implementing HasDisplayHandle on Window, or something different...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doesn't the display that the window shows up within have the actual display?

@notgull
Copy link
Member Author

notgull commented Mar 24, 2023

Superseded by #116

@notgull notgull closed this Mar 24, 2023
@notgull notgull deleted the notgull/clarify-borrowed-safety branch March 24, 2023 11:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants