Changeset 1033 for trunk/dll


Ignore:
Timestamp:
Jun 30, 2008, 3:39:39 PM (17 years ago)
Author:
John Small
Message:

Ticket 103: Fix the restore the the previous shutdown state when reopening FM/2.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/mainwnd.c

    r1032 r1033  
    5757  19 Jun 08 JBS Ticket 227: Allow temporary saving/deleting of the shutdown state of directory containers
    5858  22 Jun 08 GKY Use free_... functions for fortify checking
     59  30 Jun 08 JBS Ticket 103: Fix restore of previous shutdown state when opening FM/2
    5960
    6061***********************************************************************/
     
    188189      fNoTileUpdate = FALSE;
    189190      //xfree((char *)mp1, pszSrcFile, __LINE__);
    190       if (fAutoTile)
    191         TileChildren(hwndMain, TRUE);
     191//       if (fAutoTile)
     192//         TileChildren(hwndMain, TRUE);
    192193      break;
    193194    default:
     
    28242825          if (*szDir) {
    28252826           // If saving shutdown state skip no prescan drives
    2826            if (fIsShutDownState &&
    2827                driveflags[toupper(*szDir) - 'A'] & DRIVE_NOPRESCAN) {
    2828              continue;
    2829            }
     2827            if (fIsShutDownState &&
     2828                driveflags[toupper(*szDir) - 'A'] & DRIVE_NOPRESCAN) {
     2829              continue;
     2830            }
    28302831            sprintf(szKey, "%sDirCnrPos.%lu", szPrefix, numsaves);
    28312832            PrfWriteProfileData(fmprof, FM3Str, szKey, (PVOID) & swp,
     
    29742975  CHAR szDir[CCHMAXPATH];
    29752976  CHAR szPrefix[STATE_NAME_MAX_BYTES + 2];
    2976   HWND hwndDir, hwndC, hwndDir0 = NULLHANDLE, hwndPPSave = NULLHANDLE;
     2977  HWND hwndDir, hwndC, hwndPPSave = NULLHANDLE;
    29772978  SWP swp, swpO, swpN;
    2978   ULONG size, numsaves = 0, x;
     2979  ULONG size, numsaves = 0;
     2980  LONG x;
    29792981  double xtrans, ytrans;
    29802982  BOOL fRestored = FALSE;
     
    30553057    if (fDeleteState)
    30563058      PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L);
    3057     for (x = 0; x < numsaves; x++) {
     3059    for (x = numsaves - 1; x >= 0; x--) {
    30583060      sprintf(szKey, "%sDirCnrPos.%lu", szPrefix, x);
    30593061      size = sizeof(SWP);
     
    32323234                                      MPFROMP(szDir), MPFROMLONG(1));
    32333235          if (hwndDir) {
    3234 
    3235             if (x == 0) {
    3236               hwndDir0 = hwndDir;
    3237             }
    32383236            hwndC = WinWindowFromID(hwndDir, FID_CLIENT);
    32393237            if (hwndC) {
     
    33303328            swp.hwnd = hwndDir;
    33313329            TransformSwp(&swp, xtrans, ytrans);
    3332             if (!fAutoTile && !(swp.fl & (SWP_HIDE | SWP_MINIMIZE)))
     3330            if (swp.fl & (SWP_HIDE | SWP_MINIMIZE)) {
     3331              WinSetWindowPos(hwndDir,
     3332                              HWND_TOP, 0, 0, 0, 0, SWP_MINIMIZE | SWP_SHOW);
     3333              WinSetWindowUShort(hwndDir, QWS_XRESTORE, (USHORT) swp.x);
     3334              WinSetWindowUShort(hwndDir, QWS_CXRESTORE, (USHORT) swp.cx);
     3335              WinSetWindowUShort(hwndDir, QWS_YRESTORE, (USHORT) swp.y);
     3336              WinSetWindowUShort(hwndDir, QWS_CYRESTORE, (USHORT) swp.cy);
     3337            } else
    33333338              WinSetWindowPos(hwndDir,
    33343339                              HWND_TOP,
     
    33403345                              SWP_SIZE | SWP_SHOW |  SWP_ZORDER |
    33413346                              SWP_ACTIVATE);
    3342             else if (swp.fl & (SWP_HIDE | SWP_MINIMIZE)) {
    3343               WinSetWindowPos(hwndDir,
    3344                               HWND_TOP, 0, 0, 0, 0, SWP_MINIMIZE | SWP_SHOW);
    3345               WinSetWindowUShort(hwndDir, QWS_XRESTORE, (USHORT) swp.x);
    3346               WinSetWindowUShort(hwndDir, QWS_CXRESTORE, (USHORT) swp.cx);
    3347               WinSetWindowUShort(hwndDir, QWS_YRESTORE, (USHORT) swp.y);
    3348               WinSetWindowUShort(hwndDir, QWS_CYRESTORE, (USHORT) swp.cy);
    3349             }
    3350             else
    3351               WinSetWindowPos(hwndDir,
    3352                               HWND_BOTTOM,
    3353                               0, 0, 0, 0, SWP_ZORDER | SWP_ACTIVATE);
    33543347          }
    33553348        }
     
    33593352       SavePresParams(hwndPPSave, "DirCnr");
    33603353       WinDestroyWindow(hwndPPSave);
    3361     }
    3362     if (hwndDir0) {
    3363       WinSetFocus(HWND_DESKTOP, hwndDir0);
    33643354    }
    33653355  }
     
    57555745
    57565746  case UM_SETUP5:
    5757     if (fAutoTile)
    5758       TileChildren(hwnd, TRUE);
     5747//     if (fAutoTile)
     5748//       TileChildren(hwnd, TRUE);
    57595749    PostMsg(hwnd, UM_FILLUSERLIST, MPVOID, MPVOID);
    57605750    PostMsg(hwnd, UM_FILLSETUPLIST, MPVOID, MPVOID);
Note: See TracChangeset for help on using the changeset viewer.