jimradford / superputty

The SuperPuTTY Window Manager for putty sessions
https://www.facebook.com/superputty
MIT License
1.93k stars 321 forks source link

VNC Sessions start docked, but become undocked upon login #718

Open jimradford opened 6 years ago

jimradford commented 6 years ago

Steps to Reproduce:

  1. Create new session with host pointed to a valid VNC server running on a remote host
  2. Open Session

Result:

  1. VNC Login Windows opens and is docked
  2. Session opens TightVNC Viewer but becomes undocked after authentication

Expected Result

  1. VNC Viewer session to open and remain docked even when password prompt is used.

I notice what is likely the cause is the login box is getting docked to prompt for a password, but the child window is not captured. (side note, I also don't like the handling of a misconfigured session which brings up errors that are not related, another issue will need to be opened on this) Logfile: 2018-11-02 11:14:05,662 INFO SuperPuTTY - Opening putty session, id=VNC Test D 2018-11-02 11:14:05,664 INFO PuttyStartInfo - Putty Args: '-scale=auto "192.168.20.50::5901"' 2018-11-02 11:14:05,720 WARN ApplicationPanel - Unable to get handle for process on first try. Polling 10 s for handle. 2018-11-02 11:14:06,023 INFO ApplicationPanel - Successfully found handle via polling 302.2067 ms 2018-11-02 11:14:06,032 INFO ApplicationPanel - MoveWindow [OnVisChanged VNC Test D] w=1718, h= 695, visible=True, success=True 2018-11-02 11:14:06,034 INFO ApplicationPanel - MoveWindow [OnVisChanged VNC Test D] w=1718, h= 695, visible=True, success=True 2018-11-02 11:14:06,495 WARN ctlPuttyPanel - Unable to SetFocusToChildApplication, VNC Test D 2018-11-02 11:14:06,496 DEBUG SuperPuTTY - STATUS: Opened session: VNC Test D [VNC] 2018-11-02 11:14:19,561 DEBUG frmSuperPutty - [16668648] Activated 2018-11-02 11:14:29,066 WARN DesktopWindow - Could not get exe. error=Access is denied, process=9476 2018-11-02 11:14:29,153 INFO EventWindowActivator - [8193930] Activating Main Window - current=(?) 2018-11-02 11:14:29,158 DEBUG frmSuperPutty - [16668648] Activated 2018-11-02 11:14:29,166 INFO ApplicationPanel - [8193930] ReFocusPuTTY - puttyTab=VNC Test D, caller=WinEventProc-FG, AltTab=False, result=True 2018-11-02 11:14:38,006 DEBUG frmSuperPutty - [16668648] Activated 2018-11-02 11:14:52,431 DEBUG frmSuperPutty - [16668648] Activated 2018-11-02 11:14:52,541 INFO ApplicationPanel - [8193930] ReFocusPuTTY - puttyTab=VNC Test D, caller=SHELLHOOK, result=False 2018-11-02 11:14:52,634 INFO ApplicationPanel - [8193930] ReFocusPuTTY - puttyTab=VNC Test D, caller=SHELLHOOK, result=False 2018-11-02 11:14:52,727 INFO ApplicationPanel - [8193930] ReFocusPuTTY - puttyTab=VNC Test D, caller=SHELLHOOK, result=False 2018-11-02 11:14:52,820 INFO ApplicationPanel - [8193930] ReFocusPuTTY - puttyTab=VNC Test D, caller=SHELLHOOK, result=False 2018-11-02 11:14:52,913 INFO ApplicationPanel - [8193930] ReFocusPuTTY - puttyTab=VNC Test D, caller=SHELLHOOK, result=False 2018-11-02 11:14:52,914 WARN ctlPuttyPanel - Unable to SetFocusToChildApplication, VNC Test D

jimradford commented 6 years ago

@anishsane I notice this works fine when entering the password and launching from the quick launch toolbar.

anishsane commented 5 years ago

SuperPuTTY captures the first window created by the application. If the password is not entered, it opens a window saying "invalid password. Enter again." That window gets captured by SuperPuTTY.

Unfortunately, I don't have a known way to fix this. If there is any other VNC viewer application, which does not create such an intermediate window, we can switch to that application instead of TightVNC (needs code changes).

Because of this intermediate window, I chose TightVNC instead of RealVNC. RealVNC always created the intermediate "connecting..." window, which used to get captured by SuperPuTTY. TightVNC creates it only in case of a wrong password.

jimradford commented 5 years ago

@anishsane The solution is a more generic approach when launching child applications. We certainly have the ability to "follow" the window creation process and if we know what to expect we can deal with it accordingly. It would be like a scripting language in itself (think AutoIT, etc). That being said adding "support" for other terminal applications was never a goal of the project but has become a painful side effect.