-
-
Notifications
You must be signed in to change notification settings - Fork 145
Access Window from Pixels? #421
Copy link
Copy link
Open
Labels
enhancementNew feature or requestNew feature or requesthelp wantedExtra attention is neededExtra attention is neededquestionUsability questionUsability questionrfcRequest For Comments; A design proposalRequest For Comments; A design proposal
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requesthelp wantedExtra attention is neededExtra attention is neededquestionUsability questionUsability questionrfcRequest For Comments; A design proposalRequest For Comments; A design proposal
With the new 0.30 winit
ApplicationHandlerAPI using aPixels<'a>for any lifetime other than'staticjust got significantly harder, because all app state must now exist within one struct, which must exist before opening the window. The current workaround is to store anArc<Window>and create thePixels<'static>from it; but it would be far easier if thePixelscould own the window and simply have an accessor through which application code can use its ownWindow. Otherwise a self-referencing struct would be required with thePixelsreferencing theWindowstored alongside it in the same struct.Anyways I'm proposing
Pixels::window(&self)+Pixels::window_mut(&mut self)that return a reference to thewinit::window::WindowthePixelswas created with