From 2ac80f8e9ccbcb8538ca6e613488c3b0eb9ef124 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Fri, 28 Jun 2024 23:24:29 +0200 Subject: Fix `window::open_events` subscribing to closed events Fixes #2481. --- runtime/src/window.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'runtime') diff --git a/runtime/src/window.rs b/runtime/src/window.rs index b04e5d59..3e53dd55 100644 --- a/runtime/src/window.rs +++ b/runtime/src/window.rs @@ -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 { 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 -- cgit