From 4e8ca38eb1332582eec650f73462b67187707d19 Mon Sep 17 00:00:00 2001 From: unsecretised Date: Tue, 16 Jun 2026 18:32:00 +0800 Subject: [PATCH] Fix rapid event tap recreation --- src/app.rs | 1 - src/app/tile.rs | 10 ---------- src/app/tile/update.rs | 12 ------------ 3 files changed, 23 deletions(-) diff --git a/src/app.rs b/src/app.rs index 76358a7..1377643 100644 --- a/src/app.rs +++ b/src/app.rs @@ -167,7 +167,6 @@ pub enum Message { FileSearchClear, SetFileSearchSender(tokio::sync::watch::Sender<(String, Vec)>), DebouncedSearch(Id), - CheckEventTap, ThemeModeChanged(bool), SimulatePaste(i32), } diff --git a/src/app/tile.rs b/src/app/tile.rs index 73f3d6a..e07e5cb 100644 --- a/src/app/tile.rs +++ b/src/app/tile.rs @@ -269,7 +269,6 @@ impl Tile { Subscription::run(reload_events), Subscription::run(handle_version_and_rankings), Subscription::run(handle_theme_mode), - Subscription::run(check_event_tap), Subscription::run(handle_clipboard_history), Subscription::run(handle_file_search), window::close_events().map(Message::HideWindow), @@ -804,15 +803,6 @@ fn reload_events() -> impl futures::Stream { }) } -fn check_event_tap() -> impl futures::Stream { - stream::channel(100, async |mut output| { - loop { - tokio::time::sleep(Duration::from_secs(5)).await; - output.send(Message::CheckEventTap).await.ok(); - } - }) -} - /// Poll the system dark mode every 2 seconds and send a message when it changes. fn handle_theme_mode() -> impl futures::Stream { stream::channel(100, async |mut output| { diff --git a/src/app/tile/update.rs b/src/app/tile/update.rs index 01283ba..8c7ac1f 100644 --- a/src/app/tile/update.rs +++ b/src/app/tile/update.rs @@ -1089,18 +1089,6 @@ pub fn handle_update(tile: &mut Tile, message: Message) -> Task { Task::none() } - Message::CheckEventTap => { - info!("Re-creating global event tap"); - if let Some(ref sender) = tile.sender { - tile.hotkeys.handle = None; - match global_handler(sender.clone(), tile.hotkeys.all_hotkeys()) { - Ok(handle) => tile.hotkeys.handle = Some(handle), - Err(e) => log::error!("Failed to re-create event tap: {e}"), - } - } - Task::none() - } - Message::SimulatePaste(pid) => { crate::platform::simulate_paste(pid); Task::none()