mirror of
https://github.com/mRemoteNG/mRemoteNG.git
synced 2026-02-17 22:11:48 +08:00
find the correct InterfaceControl on conn change
This commit is contained in:
@@ -41,5 +41,13 @@ namespace mRemoteNG.Connection
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static InterfaceControl FindInterfaceControl(ConnectionTab tab)
|
||||
{
|
||||
if (tab.Controls[0] is InterfaceControl ic)
|
||||
return ic;
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -522,9 +522,11 @@ namespace mRemoteNG.UI.Forms
|
||||
|
||||
private void ActivateConnection()
|
||||
{
|
||||
var w = pnlDock.Controls[0] as DockPanel;
|
||||
if (!(w?.ActiveDocument is ConnectionTab tab)) return;
|
||||
var ifc = (InterfaceControl)tab.ActiveControl;
|
||||
var cw = pnlDock.ActiveDocument as ConnectionWindow;
|
||||
var dp = cw?.ActiveControl as DockPane;
|
||||
|
||||
if (!(dp?.ActiveContent is ConnectionTab tab)) return;
|
||||
var ifc = InterfaceControl.FindInterfaceControl(tab);
|
||||
if (ifc == null) return;
|
||||
|
||||
ifc.Protocol.Focus();
|
||||
|
||||
Reference in New Issue
Block a user