Fix window::open_events subscribing to closed events

Fixes #2481.
This commit is contained in:
Héctor Ramón Jiménez 2024-06-28 23:24:29 +02:00
parent b9eb86199a
commit 2ac80f8e9c
No known key found for this signature in database
GPG key ID: 7CC46565708259A7

View file

@ -175,7 +175,7 @@ pub fn events() -> Subscription<(Id, Event)> {
/// Subscribes to all [`Event::Closed`] occurrences in the running application.
pub fn open_events() -> Subscription<Id> {
event::listen_with(|event, _status, id| {
if let crate::core::Event::Window(Event::Closed) = event {
if let crate::core::Event::Window(Event::Opened { .. }) = event {
Some(id)
} else {
None