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

Legend:

Unmodified
Added
Removed
  • trunk/LocalPlayer/Term.pas

    r621 r622  
    1212{$ENDIF}
    1313  Protocol, Tribes, PVSB, ClientTools, ScreenTools, BaseWin, Messg, ButtonBase,
    14   LCLIntf, LCLType, Menus, SysUtils, Classes, DrawDlg, Types, Math,
     14  LCLIntf, LCLType, SysUtils, Classes, DrawDlg, Types, Math,
    1515  DateUtils, Platform, ButtonB, ButtonC, EOTButton, Area, Help,
    1616  GraphicSet, MiniMap, IsoEngine, Wonders, TechTree, Enhance, Nego, CityType,
     
    26432643          MainTexture.Age := -1;
    26442644        Tribes.Init;
    2645         HelpDlg.UserLeft := (Screen.Width - HelpDlg.Width) div 2;
    2646         HelpDlg.UserTop := (Screen.Height - HelpDlg.Height) div 2;
     2645        HelpDlg.UserLeft := Screen.PrimaryMonitor.Left + (Screen.PrimaryMonitor.Width - HelpDlg.Width) div 2;
     2646        HelpDlg.UserTop := Screen.PrimaryMonitor.Top + (Screen.PrimaryMonitor.Height - HelpDlg.Height) div 2;
    26472647        HelpDlg.Difficulty := 0;
    26482648        if Command = cStartCredits then
     
    59635963      if BattleDlg.Left < 0 then
    59645964        BattleDlg.Left := 0
    5965       else if BattleDlg.Left + BattleDlg.Width > Screen.Width then
    5966         BattleDlg.Left := Screen.Width - BattleDlg.Width;
     5965      else if BattleDlg.Left + BattleDlg.Width > Screen.DesktopWidth then
     5966        BattleDlg.Left := Screen.DesktopWidth - BattleDlg.Width;
    59675967      BattleDlg.Top := Y - BattleDlg.Height div 2;
    59685968      if BattleDlg.Top < 0 then
    59695969        BattleDlg.Top := 0
    5970       else if BattleDlg.Top + BattleDlg.Height > Screen.Height then
    5971         BattleDlg.Top := Screen.Height - BattleDlg.Height;
     5970      else if BattleDlg.Top + BattleDlg.Height > Screen.DesktopHeight then
     5971        BattleDlg.Top := Screen.DesktopHeight - BattleDlg.Height;
    59725972      BattleDlg.IsSuicideQuery := False;
    59735973      BattleDlg.Show;
     
    80658065procedure TMainScreen.FormShow(Sender: TObject);
    80668066begin
    8067   if FullScreen then BoundsRect := Bounds(0, 0, Screen.Width, Screen.Height)
     8067  if FullScreen then BoundsRect := Screen.PrimaryMonitor.BoundsRect
    80688068    else BoundsRect := TermBounds;
    80698069  FormRestoredSize := TermBounds;
     
    83878387
    83888388  if Form is TListDlg then begin;
    8389     ListDlg.UserLeft := 8;
    8390     ListDlg.UserTop := TopBarHeight + 8;
     8389    ListDlg.UserLeft := Screen.PrimaryMonitor.Left + 8;
     8390    ListDlg.UserTop := Screen.PrimaryMonitor.Top + TopBarHeight + 8;
    83918391  end;
    83928392  if Form is THelpDlg then begin
    8393    HelpDlg.UserLeft := Screen.Width - HelpDlg.Width - 8;
    8394     HelpDlg.UserTop := TopBarHeight + 8;
     8393    HelpDlg.UserLeft := Screen.PrimaryMonitor.Left + Screen.PrimaryMonitor.Width - HelpDlg.Width - 8;
     8394    HelpDlg.UserTop := Screen.PrimaryMonitor.Top + TopBarHeight + 8;
    83958395  end;
    83968396  if Form is TUnitStatDlg then begin
    8397     UnitStatDlg.UserLeft := 397;
    8398     UnitStatDlg.UserTop := TopBarHeight + 64;
     8397    UnitStatDlg.UserLeft := Screen.PrimaryMonitor.Left + 397;
     8398    UnitStatDlg.UserTop := Screen.PrimaryMonitor.Top + TopBarHeight + 64;
    83998399  end;
    84008400  if Form is TDiaDlg then begin
    8401     DiaDlg.UserLeft := (Screen.Width - DiaDlg.Width) div 2;
    8402     DiaDlg.UserTop := (Screen.Height - DiaDlg.Height) div 2;
     8401    DiaDlg.UserLeft := Screen.PrimaryMonitor.Left + (Screen.PrimaryMonitor.Width - DiaDlg.Width) div 2;
     8402    DiaDlg.UserTop := Screen.PrimaryMonitor.Top + (Screen.PrimaryMonitor.Height - DiaDlg.Height) div 2;
    84038403  end;
    84048404  if Form is TNatStatDlg then begin
    8405     NatStatDlg.UserLeft := Screen.Width - NatStatDlg.Width - 8;
    8406     NatStatDlg.UserTop := Screen.Height - PanelHeight - NatStatDlg.Height - 8;
     8405    NatStatDlg.UserLeft := Screen.PrimaryMonitor.Left + Screen.PrimaryMonitor.Width - NatStatDlg.Width - 8;
     8406    NatStatDlg.UserTop := Screen.PrimaryMonitor.Top + Screen.PrimaryMonitor.Height - PanelHeight - NatStatDlg.Height - 8;
    84078407    if NatStatDlg.UserTop < 8 then
    84088408      NatStatDlg.UserTop := 8;
Note: See TracChangeset for help on using the changeset viewer.