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

Make input backends dyn-compatible? #1654

Open
YaLTeR opened this issue Jan 30, 2025 · 0 comments
Open

Make input backends dyn-compatible? #1654

YaLTeR opened this issue Jan 30, 2025 · 0 comments

Comments

@YaLTeR
Copy link
Contributor

YaLTeR commented Jan 30, 2025

Currently compositors either have all input handling with an <I: InputBackend> generic, or manually repack the events (e.g. Catacomb). It doesn't really feel worth it to me to compile all input code three times (for libinput+winit+something like virtual input) and have it take up three times the space in the final binary.

While the main input backend trait and enum list all their event types as associated, the individual event traits only expose &self methods with simple types, all of which are already dyn-compatible. So maybe some not super major refactoring can be done?

It's important though to still be able to downcast things to the underlying type, especially to get to the real libinput device during event processing. But I believe downcast-rs should take care of that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant