mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-16 10:19:36 +02:00
win32: don't set minimized window size using SetWindowPos - we need to set the normal window position using SetWindowPlacement
git-svn-id: trunk@29755 -
This commit is contained in:
parent
0f516fc6ef
commit
66766609c8
@ -469,9 +469,13 @@ class procedure TWin32WSWinControl.SetBounds(const AWinControl: TWinControl;
|
||||
var
|
||||
IntfLeft, IntfTop, IntfWidth, IntfHeight: integer;
|
||||
suppressMove: boolean;
|
||||
Handle: HWND;
|
||||
WindowPlacement: TWINDOWPLACEMENT;
|
||||
begin
|
||||
IntfLeft := ALeft; IntfTop := ATop;
|
||||
IntfWidth := AWidth; IntfHeight := AHeight;
|
||||
IntfLeft := ALeft;
|
||||
IntfTop := ATop;
|
||||
IntfWidth := AWidth;
|
||||
IntfHeight := AHeight;
|
||||
LCLBoundsToWin32Bounds(AWinControl, IntfLeft, IntfTop, IntfWidth, IntfHeight);
|
||||
{$IFDEF VerboseSizeMsg}
|
||||
DebugLn('TWin32WSWinControl.ResizeWindow A ', dbgsName(AWinControl),
|
||||
@ -479,11 +483,20 @@ begin
|
||||
' Win32=',Format('%d, %d, %d, %d', [IntfLeft,IntfTop,IntfWidth,IntfHeight])
|
||||
);
|
||||
{$ENDIF}
|
||||
suppressMove := false;
|
||||
suppressMove := False;
|
||||
AdaptBounds(AWinControl, IntfLeft, IntfTop, IntfWidth, IntfHeight, suppressMove);
|
||||
if not suppressMove then
|
||||
Windows.SetWindowPos(AWinControl.Handle, 0, IntfLeft, IntfTop, IntfWidth, IntfHeight,
|
||||
SWP_NOZORDER or SWP_NOACTIVATE);
|
||||
begin
|
||||
Handle := AWinControl.Handle;
|
||||
WindowPlacement.length := SizeOf(WindowPlacement);
|
||||
if IsIconic(Handle) and GetWindowPlacement(Handle, @WindowPlacement) then
|
||||
begin
|
||||
WindowPlacement.rcNormalPosition := Bounds(IntfLeft, IntfTop, IntfWidth, IntfHeight);
|
||||
SetWindowPlacement(Handle, @WindowPlacement);
|
||||
end
|
||||
else
|
||||
Windows.SetWindowPos(Handle, 0, IntfLeft, IntfTop, IntfWidth, IntfHeight, SWP_NOZORDER or SWP_NOACTIVATE);
|
||||
end;
|
||||
LCLControlSizeNeedsUpdate(AWinControl, True);
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user