Skip to content

feat(native): Add winit Event handler#5604

Open
J0hannes101 wants to merge 4 commits into
DioxusLabs:mainfrom
J0hannes101:winit_event_handler
Open

feat(native): Add winit Event handler#5604
J0hannes101 wants to merge 4 commits into
DioxusLabs:mainfrom
J0hannes101:winit_event_handler

Conversation

@J0hannes101

Copy link
Copy Markdown

Adds a use_winit_event_handler() hook to the native renderer, allowing to register callbacks that fire on winit WindowEvent - analogous to use_wry_event_handler() on desktop.

@J0hannes101 J0hannes101 requested a review from a team as a code owner May 29, 2026 21:16
@ealmloff ealmloff added enhancement New feature or request native Related to dioxus-native labels May 29, 2026
@J0hannes101 J0hannes101 force-pushed the winit_event_handler branch from 9b57587 to c137a51 Compare June 19, 2026 16:46

@nicoburns nicoburns left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like a good feature, but it shouldn't use a thead-local variable. It should probably use an Rc<RefCell<_>> type shared between the Window and the Dioxus context like Dioxus Desktop does (see the DesktopContext / DesktopService types)

@J0hannes101 J0hannes101 requested a review from nicoburns July 3, 2026 08:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request native Related to dioxus-native

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants