2
0
Эх сурвалжийг харах

IDE: Set Application.MainFormOnTaskBar=True

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.

Jordan Russell 9 сар өмнө
parent
commit
c3563a2d6f

+ 3 - 0
Projects/Compil32.dpr

@@ -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

+ 5 - 1
Projects/Src/IDE.MainForm.pas

@@ -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 }