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 <noreply@anthropic.com>
This commit is contained in:
2026-08-14 14:39:19 +00:00
parent 69003ced9a
commit 9bb1ec7060
2 changed files with 5 additions and 1 deletions

View File

@@ -71,6 +71,8 @@ public final class ConnectionInfoDialog extends JDialog {
setContentPane(content); setContentPane(content);
Dialogs.closeOnEscape(this); Dialogs.closeOnEscape(this);
// Disposing is what stops the refresh timer, so the window button must not merely hide.
setDefaultCloseOperation(DISPOSE_ON_CLOSE);
pack(); pack();
setLocationRelativeTo(owner); setLocationRelativeTo(owner);

View File

@@ -151,11 +151,13 @@ public final class ServerTreePanel extends JScrollPane {
@Override @Override
public void mouseClicked(MouseEvent e) { public void mouseClicked(MouseEvent e) {
if (SwingUtilities.isLeftMouseButton(e) && e.getClickCount() == 2) {
Object obj = nodeAt(e); Object obj = nodeAt(e);
if (SwingUtilities.isLeftMouseButton(e) && e.getClickCount() == 2) {
if (obj instanceof ChannelNode && !Spacers.isSpacer(((ChannelNode) obj).name)) { if (obj instanceof ChannelNode && !Spacers.isSpacer(((ChannelNode) obj).name)) {
actions.joinChannel(((ChannelNode) obj).id); actions.joinChannel(((ChannelNode) obj).id);
} }
} else if (SwingUtilities.isMiddleMouseButton(e) && obj instanceof ClientEntry) {
actions.showConnectionInfo((ClientEntry) obj);
} }
} }
}); });