mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-07 23:20:33 +02:00
win32: fix bug with main window deactivation (caused by todays commit)
git-svn-id: trunk@12402 -
This commit is contained in:
parent
7bb6447b50
commit
924b036e96
@ -1133,20 +1133,25 @@ begin
|
||||
begin
|
||||
if WParam <> 0 then // activated
|
||||
begin
|
||||
//WriteLn('Restore');
|
||||
RestoreStayOnTopFlags(Window);
|
||||
Windows.SetWindowPos(TWin32WidgetSet(WidgetSet).AppHandle, HWND_TOP,
|
||||
0, 0, 0, 0, SWP_NOMOVE or SWP_NOSIZE or SWP_NOACTIVATE);
|
||||
end
|
||||
else
|
||||
begin // deactivated
|
||||
//WriteLn('Remove');
|
||||
RemoveStayOnTopFlags(Window);
|
||||
Windows.SetWindowPos(TWin32WidgetSet(WidgetSet).AppHandle, HWND_BOTTOM,
|
||||
0, 0, 0, 0, SWP_NOMOVE or SWP_NOSIZE or SWP_NOACTIVATE);
|
||||
end;
|
||||
|
||||
// activate/deactivate main window
|
||||
if (Application <> nil) and (Application.MainForm <> nil) and
|
||||
Application.MainForm.HandleAllocated then
|
||||
begin
|
||||
CallDefaultWindowProc(Application.MainForm.Handle, WM_NCACTIVATE, WParam, LParam);
|
||||
//WriteLn('Activate/Deactivate main window');
|
||||
CallDefaultWindowProc(Application.MainForm.Handle, WM_NCACTIVATE, WParam, 0);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
@ -1156,7 +1156,8 @@ begin
|
||||
if WindowInfo^.StayOnTopList <> nil then
|
||||
begin
|
||||
for I := 0 to WindowInfo^.StayOnTopList.Count - 1 do
|
||||
SetWindowPos(HWND(WindowInfo^.StayOnTopList.Items[I]), HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE or SWP_NOSIZE or SWP_NOACTIVATE);
|
||||
SetWindowPos(HWND(WindowInfo^.StayOnTopList.Items[I]),
|
||||
HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE or SWP_NOSIZE or SWP_NOACTIVATE);
|
||||
FreeAndNil(WindowInfo^.StayOnTopList);
|
||||
end;
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user