-
Notifications
You must be signed in to change notification settings - Fork 909
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
Allow introspection of WindowBuilder default values. #2613
Allow introspection of WindowBuilder default values. #2613
Conversation
83e67fc
to
8344da0
Compare
4071f4e
to
7d45f28
Compare
Could you show the use case for introspection? Are you passing |
+1, in nannou we wrap The removal of access to |
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.
Hmm, I was really hoping we could avoid this, but I guess this is still strictly better than what we previously had (which would've been unsound, since it would now have allowed &mut window_attributes.parent_window
).
Would it be possible to instead implement getter methods for the things you need (like already done with WindowBuilder::transparent
)? That makes it easier for us to avoid breaking changes in the future, as well as allowing internal refactors (like the fullscreen state-thing that's reverted here).
Though I guess if you need to access a lot of the state, it might just be more of a hazzle than a help, so I'm open for simply being pragmatic and just doing a #[non_exhaustive]
.
Also, I'm confused as to why you're doing all that extra work? I understand why you're setting |
I don't remember why we do this exactly, but off the top of my head likely one of the following:
I don't really mind either way. I'm more concerned about functionality being used for yrs disappearing altogether with no alternative 🥲 but as a winit maintainer alumni I can empathise with your efforts to ease maintenance. |
I just checked your code, it seems like this isn't the case.
I would argue that's a feature -
Yeah, I can understand, the reason for removal was mostly that I suspected it wasn't being used at all (which is still largely true; only some parts of the struct is used, so we can still cut down on our API surface).
Thanks for your input, and again, I'm not that against reverting the change (like, these are minor details, I'd rather spend time on the more important stuff). |
I think deprecating APIs to reduce the maintenance burden is fair, but please be careful about making assumptions around lack-of-use. If a |
Yeah good point, I do sometimes forget how old this project is! |
For my code it was purely informational, I had some routines that log out various defaults and runtime state from winit/glutin and glium, including the WindowAttributes defaults. |
Makes WindowAttributes public and adds window_attributes() getter to WindowBuilder. In version 0.27, the WindowAttributes struct was made private, but this removed the ability to introspect the default WindowBuilder values.
7d45f28
to
5fa4be1
Compare
Cc #2134, which this PR reverts. |
Makes WindowAttributes public and add window_attributes() getter to WindowBuilder.
In version 0.27, the WindowAttributes struct was made private, but this removed the ability to introspect the default WindowBuilder values.
CHANGELOG.md
if knowledge of this change could be valuable to users