Skip to content

feat(native): Add winit Event handler#5604

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

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
nicoburns added a commit to nicoburns/blitz that referenced this pull request Jul 7, 2026
This is a port of DioxusLabs/dioxus#5604 to
the Blitz repo.

Signed-off-by: Nico Burns <nico@nicoburns.com>
Co-authored-by: Johannes Haase <johannes.haase@schneeberg-erz.de>
nicoburns added a commit to DioxusLabs/blitz that referenced this pull request Jul 7, 2026
* Add global Winit WindowEvent handler

This is a port of DioxusLabs/dioxus#5604 to
the Blitz repo.

Signed-off-by: Nico Burns <nico@nicoburns.com>
Co-authored-by: Johannes Haase <johannes.haase@schneeberg-erz.de>

* Add ctrl+t and ctrl+w shortcuts to browser app

---------

Signed-off-by: Nico Burns <nico@nicoburns.com>
Co-authored-by: Johannes Haase <johannes.haase@schneeberg-erz.de>
@nicoburns

Copy link
Copy Markdown
Member

I've ported this to the upstream version of Dioxus Native in the Blitz repo: DioxusLabs/blitz#493 (I've credited you as Co-Author :))

This repo should get the change next time it syncs from upstream :)

@nicoburns nicoburns closed this Jul 7, 2026
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