Bug Switching to another window when opening any settings dialog

Posted by Gore on Mon 02 Apr 2007 09:53 AM — 9 posts, 33,403 views.

#0
For some reason mushclient is switching to another program and then switching back whenever I open any of the settings dialogs. Any ideas?

Started with version 4.00/4.01, downgraded to 3.85 and seems to do it on that as well.

USA #1
might have to do with another open program fighting for active status, or "on-top" status, that happens in the split second before the settings dialog actually is spawned.
#2
Doesn't matter what program it is, the last active window prior to mushclient becomes active for a moment.

Had it working right for a moment, not sure what I did.. but I closed my world file reopened and the bug came back.
USA #3
No problems here. Sounds like it's a bug with Windows. I know that for example the starting MUSHClient graphic has black blotches on it, but that's a bug not of MUHSclient but an issues with the Windows registry.
Australia Forum Administrator #4
I had been noticing something along those lines recently, but couldn't put my finger on it. It seemed to flicker slightly when you opened the world configuration.

I think it started in 3.85, when I look at it more closely. There was a new feature there that the memory usage was only calculated on demand (clicking a button), and when you did so a progress dialog appeared.

However due to the way it was coded, if you had less than 1000 lines in the output window, the progress bar still appeared, very briefly. This probably accounts for the flicker. That will be fixed in version 4.02. The patch to the source, in case Zeno wants to try it, is:


$ cvs diff -c prefspropertypages.cpp
Index: prefspropertypages.cpp
===================================================================
RCS file: /cvs/mushclient/prefspropertypages.cpp,v
retrieving revision 1.92
diff -c -r1.92 prefspropertypages.cpp
*** prefspropertypages.cpp      1 Apr 2007 04:44:31 -0000       1.92
--- prefspropertypages.cpp      2 Apr 2007 21:29:01 -0000
***************
*** 8268,8278 ****
  void CPrefsP15::CalculateMemoryUsage ()
    {

!   CProgressDlg ProgressDlg;
!   ProgressDlg.Create ();
!   ProgressDlg.SetStatus ("Calculating memory usage...");
!   ProgressDlg.SetRange (0, m_doc->m_LineList.GetCount ());
!   ProgressDlg.SetWindowText ("Memory used by output buffer");


  // work out how much memory each line takes

--- 8268,8283 ----
  void CPrefsP15::CalculateMemoryUsage ()
    {

!   CProgressDlg * pProgressDlg = NULL;
!
!   if (m_doc->m_LineList.GetCount () > 1000)
!     {
!     pProgressDlg = new CProgressDlg;
!     pProgressDlg->Create ();
!     pProgressDlg->SetStatus ("Calculating memory usage...");
!     pProgressDlg->SetRange (0, m_doc->m_LineList.GetCount ());
!     pProgressDlg->SetWindowText ("Memory used by output buffer");

!     }

  // work out how much memory each line takes

***************
*** 8286,8296 ****
      {
      iCount++;

!     if ((iCount & 63) == 0)
!       ProgressDlg.SetPos (iCount);

!     if (ProgressDlg.CheckCancelButton())     // abort if user cancels
!       return;

      CLine * pLine = m_doc->m_LineList.GetNext (pos);
      nMemory += sizeof CLine;          // add the class itself
--- 8291,8307 ----
      {
      iCount++;

!     if (pProgressDlg)
!       {
!       if ((iCount & 63) == 0)
!         pProgressDlg->SetPos (iCount);

!       if (pProgressDlg->CheckCancelButton())     // abort if user cancels
!         {
!         delete pProgressDlg;
!         return;
!         }
!       }

      CLine * pLine = m_doc->m_LineList.GetNext (pos);
      nMemory += sizeof CLine;          // add the class itself
***************
*** 8330,8335 ****
--- 8341,8348 ----

    GetDlgItem (IDC_CALCULATE_MEMORY)->EnableWindow (FALSE);  // only do it once


+
+   delete pProgressDlg;

    } // end of  CPrefsP15::CalculateMemoryUsage



USA #5
I'd patch that in if I could actually get MC to show me what you guys are talking about. :P
Australia Forum Administrator #6
Make a new session with less than 1000 lines in the output window. Then when you open the configuration window if you watch closely you will see the progress bar flicker in, which makes the whole client window flicker into inactivity for a moment.
USA #7
Ah, under 1000 lines. Okay yeah, I see it now.

Patched applied, seems fine now.
#8
ah, thanks