Skip to content

Winit Backend: Created an EventResult::Retarget(_) to allow event handlers to send events to other windows#11269

Open
npwoods wants to merge 2 commits intoslint-ui:masterfrom
npwoods:winit_retarget_events
Open

Winit Backend: Created an EventResult::Retarget(_) to allow event handlers to send events to other windows#11269
npwoods wants to merge 2 commits intoslint-ui:masterfrom
npwoods:winit_retarget_events

Conversation

@npwoods
Copy link
Copy Markdown
Contributor

@npwoods npwoods commented Apr 5, 2026

This allows Custom Application Handlers and Window-specific event filters to cause events to be dispatched to other windows. When this is done, the two types of handlers will be reinvoked.

npwoods and others added 2 commits April 4, 2026 20:12
…andlers to send events to other windows

This allows Custom Application Handlers and Window-specific event filters to cause events to be dispatched to other windows.  When this is done, the two types of handlers will be reinvoked.
@ogoffart
Copy link
Copy Markdown
Member

ogoffart commented Apr 8, 2026

Could you elaborate on what is the usecase for this feature?

@npwoods
Copy link
Copy Markdown
Contributor Author

npwoods commented Apr 8, 2026

In my case I create my own child window with winit outside the purview of Slint (I submitted a hook earlier #8150 which got correctly obsoleted by the newer CustomApplicationHandler infrastructure). I don't have control over the logic attached to this window, but I do have (again with CustomApplicationHandler) access to the events.

For things like menu shortcuts to work properly, I need to retarget some events to the Slint window.

I'm open to the possibility that there might be a better way to do this. In my case changing the WindowId is sufficient, but I could see a more flexible solution being a facility to modify the event in its entirety. Your call.

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

Successfully merging this pull request may close these issues.

2 participants