Skip to content

docs: Improve documentation for safe window handles#114

Closed
notgull wants to merge 1 commit intomasterfrom
notgull/clarify-borrowed-safety
Closed

docs: Improve documentation for safe window handles#114
notgull wants to merge 1 commit intomasterfrom
notgull/clarify-borrowed-safety

Conversation

@notgull
Copy link
Copy Markdown
Contributor

@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
Copy Markdown
Contributor 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
Copy Markdown
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
Copy Markdown
Contributor 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