From 3821fff1d23721e6f243f80e0f1f1be389d3e7dc Mon Sep 17 00:00:00 2001 From: ThisSeanZhang <46880100+ThisSeanZhang@users.noreply.github.com> Date: Sun, 26 Sep 2021 21:39:04 +0800 Subject: [PATCH 1/2] Unlisten to an event on this window --- core/tauri/src/window.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/tauri/src/window.rs b/core/tauri/src/window.rs index bf023020ac0..d0113301e06 100644 --- a/core/tauri/src/window.rs +++ b/core/tauri/src/window.rs @@ -271,6 +271,11 @@ impl Window { self.manager.listen(event.into(), Some(label), handler) } + /// Unlisten to an event on this window. + pub fn unlisten(&self, handler_id: EventHandler) { + self.manager.unlisten(handler_id) + } + /// Listen to a an event on this window a single time. pub fn once(&self, event: impl Into, handler: F) -> EventHandler where From 6d4546972dc384c37de338f385214633085a1c94 Mon Sep 17 00:00:00 2001 From: Lucas Nogueira Date: Mon, 27 Sep 2021 16:35:39 -0300 Subject: [PATCH 2/2] change file --- .changes/unlisten.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changes/unlisten.md diff --git a/.changes/unlisten.md b/.changes/unlisten.md new file mode 100644 index 00000000000..d60cce4adc4 --- /dev/null +++ b/.changes/unlisten.md @@ -0,0 +1,5 @@ +--- +"tauri": patch +--- + +Adds `unlisten` function to the `Window` struct.