winit update (0.30.11 +)
- Dominant language
- Rust
- Stars
- 30.6k
- Forks
- 2.1k
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 72
Description
Is there a branch/progress for updating eframe to the latest winit release?
It is probably going to look like that:
- introducing a new Event: `egui::Event::FilesOpened { paths }`
- adding a handler here `impl ApplicationHandler for WinitAppWrapper `:
```rust
fn open_files_event(
&mut self,
event_loop: &ActiveEventLoop,
paths: Vec,
) {
if !paths.is_empty() {
// Add the event to egui's raw input
self.winit_app
.egui_input_mut()
.events
.push(egui::Event::FilesOpened { paths }); // Ensure `egui::Event` is in scope
// Request egui to repaint all its viewports.
// egui will then send repaint requests to winit.
if let Some(egui_ctx) = self.winit_app.egui_ctx() {
for viewport_id_key in egui_ctx.viewport_ids() {
egui_ctx.request_repaint_viewport(viewport_id_key);
}
}
// Ensure the event loop polls to process the new event and repaint requests.
event_loop.set_control_flow(ControlFlow::Poll);
}
}
```
I'm trying to implement `AppDelegates` for macOS in winit and expose them to eframe (to handle for example the `open with...` function as requested in #5620 and #7057.
Contributor guide
Research direction
Start at the WinitAppWrapper ApplicationHandler implementation and compare eframe’s current winit integration with winit 0.30.11+. Trace how macOS AppDelegates and open-with events should become egui::Event::FilesOpened, including the repaint behavior shown in the issue. Done means eframe builds against the target winit release and exposes the behavior requested in #5620 and #7057.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- desktop
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100