From 9bb1ec7060e32e2c2ffc1317fea66081bd72718a Mon Sep 17 00:00:00 2001 From: ericek111 Date: Fri, 14 Aug 2026 14:39:19 +0000 Subject: [PATCH] Open connection info by middle-clicking a client The dialog now disposes when its window button is used, too: hiding it left the one-second refresh timer polling the server for a window nobody could see again. Co-Authored-By: Claude Opus 5 --- .../src/main/java/com/ts3client/ui/ConnectionInfoDialog.java | 2 ++ .../swing/src/main/java/com/ts3client/ui/ServerTreePanel.java | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ts3-client/swing/src/main/java/com/ts3client/ui/ConnectionInfoDialog.java b/ts3-client/swing/src/main/java/com/ts3client/ui/ConnectionInfoDialog.java index b4d1d44..82442f2 100644 --- a/ts3-client/swing/src/main/java/com/ts3client/ui/ConnectionInfoDialog.java +++ b/ts3-client/swing/src/main/java/com/ts3client/ui/ConnectionInfoDialog.java @@ -71,6 +71,8 @@ public final class ConnectionInfoDialog extends JDialog { setContentPane(content); Dialogs.closeOnEscape(this); + // Disposing is what stops the refresh timer, so the window button must not merely hide. + setDefaultCloseOperation(DISPOSE_ON_CLOSE); pack(); setLocationRelativeTo(owner); diff --git a/ts3-client/swing/src/main/java/com/ts3client/ui/ServerTreePanel.java b/ts3-client/swing/src/main/java/com/ts3client/ui/ServerTreePanel.java index ba261f0..52af08b 100644 --- a/ts3-client/swing/src/main/java/com/ts3client/ui/ServerTreePanel.java +++ b/ts3-client/swing/src/main/java/com/ts3client/ui/ServerTreePanel.java @@ -151,11 +151,13 @@ public final class ServerTreePanel extends JScrollPane { @Override public void mouseClicked(MouseEvent e) { + Object obj = nodeAt(e); if (SwingUtilities.isLeftMouseButton(e) && e.getClickCount() == 2) { - Object obj = nodeAt(e); if (obj instanceof ChannelNode && !Spacers.isSpacer(((ChannelNode) obj).name)) { actions.joinChannel(((ChannelNode) obj).id); } + } else if (SwingUtilities.isMiddleMouseButton(e) && obj instanceof ClientEntry) { + actions.showConnectionInfo((ClientEntry) obj); } } });