Skip to content

Split backends out into separate crates#4226

Closed
madsmtm wants to merge 8 commits intomasterfrom
madsmtm/winit-crates
Closed

Split backends out into separate crates#4226
madsmtm wants to merge 8 commits intomasterfrom
madsmtm/winit-crates

Conversation

@madsmtm
Copy link
Copy Markdown
Member

@madsmtm madsmtm commented May 15, 2025

WIP. Part of #3433. Builds upon #4225.

madsmtm added 8 commits May 15, 2025 22:45
Reproduce with:
find ./src/platform_impl -type f -exec sed -i '' 's/crate::/winit_core::/g' {} \;
find ./src/platform_impl -type f -exec sed -i '' 's/winit_core::platform/crate::platform/g' {} \;
find ./src/platform_impl -type f -exec sed -i '' 's/winit_core::dpi::/dpi::/g' {} \;
cargo +nightly fmt
@madsmtm madsmtm added S - api Design and usability S - maintenance Repaying technical debt labels May 15, 2025
@kchibisov
Copy link
Copy Markdown
Member

I'd generally do one PR per backend.

Figure out how to do EventLoopBuilder.

can do same as attrs? But I don't think anything should be done though, like you can still import the type from other backend directly for now.

@madsmtm
Copy link
Copy Markdown
Member Author

madsmtm commented May 16, 2025

I'd generally do one PR per backend.

Yeah, I opened this mostly to show that I'm working on it (so that we didn't do duplicate work).

Figure out how to do EventLoopBuilder.

can do same as attrs? But I don't think anything should be done though, like you can still import the type from other backend directly for now.

I meant we have winit_appkit::EventLoopBuilderExtMacOS which is implemented for winit::EventLoopBuilder, and I'm unsure of how to do that nicely.

@kchibisov
Copy link
Copy Markdown
Member

I meant we have winit_appkit::EventLoopBuilderExtMacOS which is implemented for winit::EventLoopBuilder, and I'm unsure of how to do that nicely.

But this is the same as it was with the WindowAttributes, the same platform attributes might work. Though, the issue is that it's not clear in some cases what will be built. Though, one can invert it, so you put EventLoopBuilder into e.g. macOS builder.

@madsmtm
Copy link
Copy Markdown
Member Author

madsmtm commented May 21, 2025

I figured out how to resolve the EventLoopBuilderExtMacOS stuff, and have split this into separate PRs, see the status in #3433.

@madsmtm madsmtm closed this May 21, 2025
@madsmtm madsmtm deleted the madsmtm/winit-crates branch May 21, 2025 12:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S - api Design and usability S - maintenance Repaying technical debt

Development

Successfully merging this pull request may close these issues.

2 participants