From e70cedaf16c46e32e7d8588d93a81af5a86b84cf Mon Sep 17 00:00:00 2001 From: James Elliott Date: Mon, 7 Oct 2024 09:54:39 -0500 Subject: [PATCH] Use event dispatch thread to update UI when Carabiner vanishes. --- CHANGELOG.md | 1 + src/beat_link_trigger/carabiner.clj | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9805eb95..7674cdca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,7 @@ This change log follows the conventions of Thanks to [Deniz Gencer, @Firedude1](https://github.com/Firedude1) who noticed it was thrashing his GPU and reported this. - An error in the helper code for user expressions caused an exception when attempting to use the `track-length` convenience variable with real (but not simulated) events. +- The code for handling an abrupt disconnection from the Carabiner daemon was trying to update the user interface on the wrong thread. ## [7.4.1] - 2024-06-01 diff --git a/src/beat_link_trigger/carabiner.clj b/src/beat_link_trigger/carabiner.clj index d0057868..df69c8d9 100644 --- a/src/beat_link_trigger/carabiner.clj +++ b/src/beat_link_trigger/carabiner.clj @@ -143,7 +143,8 @@ "Carabiner unexpectedly closed our connection; is it still running?" "Carabiner Connection Closed" javax.swing.JOptionPane/WARNING_MESSAGE))) - (seesaw/value! (seesaw/select @carabiner-window [:#sync-mode]) "Off") + (seesaw/invoke-later + (seesaw/value! (seesaw/select @carabiner-window [:#sync-mode]) "Off")) (update-connected-status) (update-link-status (beat-carabiner/state))))