Changeset 622 for trunk/Start.pas


Ignore:
Timestamp:
Sep 15, 2024, 10:04:45 PM (4 days ago)
Author:
chronos
Message:
  • Modified: Show windows by default on primary screen if multiple monitors present.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Start.pas

    r597 r622  
    252252    end; // default AI not found, use any
    253253
    254   DirectDlg.Left := (Screen.Width - DirectDlg.Width) div 2;
    255   DirectDlg.Top := (Screen.Height - DirectDlg.Height) div 2;
     254  DirectDlg.CenterToScreen;
    256255
    257256  UpdateInterface;
     
    509508begin
    510509  if FullScreen then begin
    511     Location := Point((Screen.Width - 800) * 3 div 8,
    512       Screen.Height - Height - (Screen.Height - 600) div 3);
     510    Location := Point(Screen.PrimaryMonitor.Left + (Screen.PrimaryMonitor.Width - 800) * 3 div 8,
     511      Screen.PrimaryMonitor.Top + Screen.PrimaryMonitor.Height - Height - (Screen.PrimaryMonitor.Height - 600) div 3);
    513512    BoundsRect := Bounds(Location.X, Location.Y, Width, Height);
    514513
     
    524523    DeleteObject(r0); // causes crash with Windows 95
    525524  end else begin
    526     BoundsRect := Bounds((Screen.Width - Width) div 2,
    527       (Screen.Height - Height) div 2, Width, Height);
     525    CenterToScreen;
    528526  end;
    529527end;
Note: See TracChangeset for help on using the changeset viewer.