Skip to content

Commit

Permalink
Don't treat 'WindowEvent::CloseRequested' as consumed in egui-winit (#…
Browse files Browse the repository at this point in the history
…3627)

This appears to have been 'consumed' by the viewport changes at one
point (by updating `viewport_info`), but this is no longer the case. We
should avoid marking this as 'consumed', so that applications know to
continue processing this event after passing it to egui.

<!--
Please read the "Making a PR" section of
[`CONTRIBUTING.md`](https://github.com/emilk/egui/blob/master/CONTRIBUTING.md)
before opening a Pull Request!

* Keep your PR:s small and focused.
* If applicable, add a screenshot or gif.
* If it is a non-trivial addition, consider adding a demo for it to
`egui_demo_lib`, or a new example.
* Do NOT open PR:s from your `master` branch, as that makes it hard for
maintainers to add commits to your PR.
* Remember to run `cargo fmt` and `cargo cranky`.
* Open the PR as a draft until you have self-reviewed it and run
`./scripts/check.sh`.
* When you have addressed a PR comment, mark it as resolved.

Please be patient! I will review your PR, but my time is limited!
-->
  • Loading branch information
Aaron1011 authored Nov 26, 2023
1 parent 6715ed5 commit fbccd3a
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions crates/egui-winit/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -427,18 +427,14 @@ impl State {
}

// Things that may require repaint:
WindowEvent::CloseRequested => EventResponse {
consumed: true,
repaint: true,
},

WindowEvent::CursorEntered { .. }
| WindowEvent::Destroyed
| WindowEvent::Occluded(_)
| WindowEvent::Resized(_)
| WindowEvent::Moved(_)
| WindowEvent::ThemeChanged(_)
| WindowEvent::TouchpadPressure { .. } => EventResponse {
| WindowEvent::TouchpadPressure { .. }
| WindowEvent::CloseRequested => EventResponse {
repaint: true,
consumed: false,
},
Expand Down

0 comments on commit fbccd3a

Please sign in to comment.