Skip to content

Commit

Permalink
IDE: Set Application.MainFormOnTaskBar=True
Browse files Browse the repository at this point in the history
Fixes two issues (seen on Windows 11):
- No animation when minimizing and restoring
- If you maximized the window, then minimized, then moved the mouse over the taskbar thumbnail, the window was shown in an incorrect position, partly off the edge of the screen.

It can't be enabled for /WIZARD currently because MainForm is hidden in that case.
  • Loading branch information
jordanrussell authored Dec 2, 2024
1 parent 9679c0d commit c3563a2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions Projects/Compil32.dpr
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,9 @@ begin
CheckParams;
RegisterApplicationRestart;

if not CommandLineWizard then
Application.MainFormOnTaskBar := True;

{ The 'with' is so that the Delphi IDE doesn't mess with these }
with Application do begin
if CommandLineWizard then
Expand Down
6 changes: 5 additions & 1 deletion Projects/Src/IDE.MainForm.pas
Original file line number Diff line number Diff line change
Expand Up @@ -1110,7 +1110,11 @@ destructor TMainForm.Destroy;
Ini.WriteInteger('State', 'WindowTop', WindowPlacement.rcNormalPosition.Top);
Ini.WriteInteger('State', 'WindowRight', WindowPlacement.rcNormalPosition.Right);
Ini.WriteInteger('State', 'WindowBottom', WindowPlacement.rcNormalPosition.Bottom);
Ini.WriteBool('State', 'WindowMaximized', WindowState = wsMaximized);
{ The GetWindowPlacement docs claim that "flags" is always zero.
Fortunately, that's wrong. WPF_RESTORETOMAXIMIZED is set when the
window is either currently maximized, or currently minimized from a
previous maximized state. }
Ini.WriteBool('State', 'WindowMaximized', WindowPlacement.flags and WPF_RESTORETOMAXIMIZED <> 0);
Ini.WriteInteger('State', 'StatusPanelHeight', FromCurrentPPI(StatusPanel.Height));

{ Zoom state }
Expand Down

0 comments on commit c3563a2

Please sign in to comment.