Closing no longer repeats

Closes #108

Turns out there was a property on KeyEvent this whole time... oops.
This commit is contained in:
Jonathan Johnson 2024-01-06 14:55:49 -08:00
parent cda13c42a2
commit e548f1255d
No known key found for this signature in database
GPG key ID: A66D6A34D6620579
2 changed files with 6 additions and 1 deletions

View file

@ -71,6 +71,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
`IntoDynamic<Progress>`. In general, this should not cause any code breakages
unless the traits were being used in generics.
- `Space` now honors `ConstraintLimit::Fill` in its layout.
- When handling the Ctrl/Cmd+W shortcut to close windows, repeat keys are now
ignored.
### Changed

View file

@ -999,7 +999,10 @@ where
{
match input.logical_key {
Key::Character(ch) if ch == "w" && window.modifiers().primary() => {
if input.state.is_pressed() && self.behavior.close_requested(window) {
if !input.repeat
&& input.state.is_pressed()
&& self.behavior.close_requested(window)
{
self.should_close = true;
window.set_needs_redraw();
}