mRemoteNG icon indicating copy to clipboard operation
mRemoteNG copied to clipboard

External Tool opens behind mRemoteNG window

Open asdert2 opened this issue 6 years ago • 5 comments
trafficstars

Hi! External Tool (winbox in my case) opens behind mRemoteNG window when I double click on Connection. But when I right click on Connection and chose External Tool submenu and click on externel tool (winbox) - it opens on top of the mRemoteNG window as it should. The Connection Protocol is set to External Tool / Winbox in Connection properties.

Expected Behavior

External Tool should open on top of mRemoteNG window when I double click on Connection.

Current Behavior

External Tool (winbox in my case) opens behind mRemoteNG window when I double click on Connection. It seems It happens only if at least one RDP connection already opened in a tab.

Possible Solution

Have no idea how can it be fixed.

Steps to Reproduce (for bugs)

  1. Set up a new Connection with hostname, login and password.
  2. Configure External tool to start C:\Program Files\winbox.exe with these arguments: %HOSTNAME% %USERNAME% %PASSWORD%
  3. Set Protocol to External Tool / Winbox in Connection properties
  4. Open any RDP connection in a new tab.
  5. Double click on a new winbox Connection and it will be opened behind mRemoteNG.

Context

Every time I have to minimize mRemoteNG manually after connecting to winbox.

Your Environment

  • Version used: 1.76.11.40527
  • Operating System and version (e.g. Windows 10 1709 x64): Windows 10 1809 x64

asdert2 avatar Feb 02 '19 12:02 asdert2

Just one more clarification. I have niticed that this bug occurs if some rdp connection is already opened. If you close all connections (all tabs) and open winbox - it opens as it should, on top of mremote window.

asdert2 avatar Mar 29 '19 17:03 asdert2

@Kvarkas I had a look:

  1. Small unrelated? buggy code found - The following code is incorrectly using the bitwise | instead of the logical ||.

In ExternalToolsToolStrip.cs line 103: if (selectedTreeNode != null && selectedTreeNode.GetTreeNodeType() == TreeNodeType.Connection | selectedTreeNode.GetTreeNodeType() == TreeNodeType.PuttySession)

I don't think that will solve the problem, but it's worth correcting that if you can. It's just a quick improvement.

  1. Background: OnMouse_DoubleClick is probably the handler in question in ConnectionTree.cs line 466.
  • This goes through a design time dependency injection pattern thing and eventually gets to OpenConnectionClickHandler.Execute.
  • This calls IConnectionInitiator.OpenConnection which is directly linked to ConnectionInitiator.OpenConnection in ConnectionInitiator.cs
  • This calls OpenConnection in the same class, which creates an instance of IntegratedProgram (ProtocolBase), then Connect is called on this.
  • For an External Program it ends up calling ExternalTool ... eventually getting to StartExternalProcess.
  1. Background: nItem.Click is likely the event emitter in ConnectionWindows.cs.
  • This calls ExternalTool.cs ExternalTool.Start
  • This then directly calls StartExternalProcess
  • For an Integrated Process, it has to build its own ConnectionInfo. It creates a new blank ConnectionInfo then sets 4 fields directly.
  1. I don't see any obvious reasons why the variations between [2] and [3] could result in the buggy experience.

merarischroeder avatar Nov 16 '21 11:11 merarischroeder

@merarischroeder well spotted! Has bin fixed, thanks

Kvarkas avatar Nov 16 '21 13:11 Kvarkas

Hi Guys, I am having an issue with this where the password I am entering into the Password field, obviously isnt being carried across correctly as when I execuite the session Winbox opens but fails to login as the password is incorrect, if I manually re-type it into the opened Winbox winodow I can login sucessfully.

bgpexchange avatar Oct 28 '24 21:10 bgpexchange

Hi Guys, I am having an issue with this where the password I am entering into the Password field, obviously isnt being carried across correctly as when I execuite the session Winbox opens but fails to login as the password is incorrect, if I manually re-type it into the opened Winbox winodow I can login sucessfully.

could you please mentioned version you have iisues with?

Kvarkas avatar Oct 29 '24 08:10 Kvarkas