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

Platform-specific getters on WindowAttributes #3313

Closed
daxpedda opened this issue Dec 24, 2023 · 3 comments · Fixed by #3318
Closed

Platform-specific getters on WindowAttributes #3313

daxpedda opened this issue Dec 24, 2023 · 3 comments · Fixed by #3318
Labels
S - api Design and usability

Comments

@daxpedda
Copy link
Member

Currently WindowAttributess purpose is to expose the current state of WindowBuilder. But it doesn't support platform-specific fields.
It would be nice to move PlatformSpecificWindowBuilderAttributes into WindowAttributes so we can do that.

Alternatively, I'm not entirely sure why WindowAttributes exists in the first place if seemingly we could let users just get free (mutable) access to WindowBuilder fields and the ones we don't want them to get access to can have getters/setters.

What do you guys think?

@daxpedda daxpedda added the S - api Design and usability label Dec 24, 2023
@notgull
Copy link
Member

notgull commented Dec 25, 2023

Personally I think it's a good value add over having the structure's fields be exposed normally (semver issues). Although I support having the ability to access those platform specific fields as well. It would make it easier to make fuller wrappers around winit (e.g. async-winit)

@madsmtm
Copy link
Member

madsmtm commented Dec 25, 2023

I dislike WindowAttributes, and think it should've been private to begin with; it allows us to more easily change implementation details, while still exposing a stable API behind the setter methods. But then again, Winit is perma-unstable, so eh, maybe it doesn't really matter.

Back when I tried to remove it in #2134, it was met by resistance because there were no getters, and that broke people relying on being able to access the current builder values.

@daxpedda
Copy link
Member Author

daxpedda commented Dec 25, 2023

See #2613 for the discussion on why it was reverted.

Generally speaking I really do dislike WindowAttributes, but I've learned over time that having builders without getters will always spawn requests for them, so I tend to consider them "good API design".

Personally I think we either remove WindowAttributes and introduce a lot of getters, or leave WindowAttributes in place.

In the meantime I will go ahead and move PlatformSpecificWindowBuilderAttributes into WindowAttributes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S - api Design and usability
Development

Successfully merging a pull request may close this issue.

3 participants