Skip to content
This repository has been archived by the owner on Nov 12, 2022. It is now read-only.

Configurable additional timing #25

Open
blackoise opened this issue Sep 29, 2011 · 1 comment
Open

Configurable additional timing #25

blackoise opened this issue Sep 29, 2011 · 1 comment

Comments

@blackoise
Copy link

Some users still have problems with non attaching putty windows.
It seems that the timing for the additional timing.
Best thing to do at this moment is to make the amount of time configurable.

@SkyBeam
Copy link

SkyBeam commented Dec 15, 2011

Hi,

Actually I had a look at the code and did some research. It seems to me that the MainWindowHandle property sometimes returns 0 even if WaitForInputIdle() is called before. So I have inserted some code to work-around this (ctlApplicationPanel.cs, Line 1219ff):

                // Additional timing
                if(Classes.Database.GetBooleanKey("additional_timing", false))
                {
                 System.Threading.Thread.Sleep(200);
                }

                for (int i = 0; i < 500; i++)
                {
                    if (m_Process.MainWindowHandle != IntPtr.Zero)
                    {
                        break;
                    }
                    System.Threading.Thread.Sleep(20);
                    m_Process.Refresh();
                }

                m_AppWin = m_Process.MainWindowHandle;

This additional for-loop basically works for me with PuTTY 0.60, 0.61 and 0.62. So this makes me believe it even works for future versions.

I have even removed the "additional timing" part as it seems not to be required any more.

Maybe this code can be reviewed and included in a future release.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants