Skip to content

Remove WindowBuilder in favour of WindowAttributes#3400

Closed
madsmtm wants to merge 2 commits intomasterfrom
remove-windowbuilder
Closed

Remove WindowBuilder in favour of WindowAttributes#3400
madsmtm wants to merge 2 commits intomasterfrom
remove-windowbuilder

Conversation

@madsmtm
Copy link
Member

@madsmtm madsmtm commented Jan 15, 2024

Blocked on #3318.

Rough draft, the plan is to move towards:

let attrs = WindowAttributes::new().with_title("MyTitle");
let window = event_loop.create_window(attrs).unwrap();

I think in this case it makes sense to remove the builder, because it really is just attributes; but in a case like EventLoopBuilder, I think it still makes sense to keep that as a builder.

  • Tested on all platforms changed
  • Added an entry to CHANGELOG.md if knowledge of this change could be valuable to users
  • Updated documentation to reflect any user-facing changes, including notes of platform-specific behavior
  • Created or updated an example program if it would help users understand this functionality
  • Updated feature matrix, if new features were added or implemented

daxpedda and others added 2 commits December 26, 2023 22:15
Move `PlatformSpecificWindowBuilderAttributes` into `WindowAttributes`.
@madsmtm madsmtm added S - api Design and usability C - needs discussion Direction must be ironed out labels Jan 15, 2024
@kchibisov
Copy link
Member

I think I have it ported on winit-next the way you suggested, however there's an issue with extensibility of it in the future. Like with dynamic backend we can't really account for everything ahead of time, so I was thinking that maybe we should create a trait with defaults?

But in general having the same type is fine by me. it's called a builder because of the pattern with the build, but really it's just a bunch of attributes and a method to set them.

@daxpedda
Copy link
Member

daxpedda commented Feb 2, 2024

Closing in favor #3447.

@daxpedda daxpedda closed this Feb 2, 2024
@madsmtm madsmtm deleted the remove-windowbuilder branch February 23, 2024 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C - needs discussion Direction must be ironed out S - api Design and usability

Development

Successfully merging this pull request may close these issues.

3 participants