mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-15 19:59:31 +01:00
LCL: optimized TCustomForm.UpdateShowInTaskBar
git-svn-id: trunk@24750 -
This commit is contained in:
parent
686b6e177b
commit
81a5b44f7b
@ -437,6 +437,7 @@ type
|
||||
FOnWindowStateChange: TNotifyEvent;
|
||||
FPixelsPerInch: Longint;
|
||||
FPosition: TPosition;
|
||||
FRealizedShowInTaskBar: TShowInTaskbar;
|
||||
FRestoredLeft: integer;
|
||||
FRestoredTop: integer;
|
||||
FRestoredWidth: integer;
|
||||
|
||||
@ -771,8 +771,8 @@ procedure TCustomForm.UpdateShowInTaskBar;
|
||||
var
|
||||
Value: TShowInTaskBar;
|
||||
begin
|
||||
if (Application.MainForm = Self) or (not HandleAllocated)
|
||||
or (FormStyle = fsMDIChild) then Exit;
|
||||
if (Application.MainForm = Self) or (not HandleAllocated) or (Parent<>nil)
|
||||
or (FormStyle = fsMDIChild) or (not Showing) then Exit;
|
||||
Value := ShowInTaskBar;
|
||||
if (Value = stDefault) or (csDesigning in ComponentState) then
|
||||
case Application.TaskBarBehavior of
|
||||
@ -780,7 +780,10 @@ begin
|
||||
tbMultiButton: Value := stAlways;
|
||||
else // nothing
|
||||
end;
|
||||
TWSCustomFormClass(WidgetSetClass).SetShowInTaskbar(Self, Value);
|
||||
if FRealizedShowInTaskBar<>Value then begin
|
||||
FRealizedShowInTaskBar:=Value;
|
||||
TWSCustomFormClass(WidgetSetClass).SetShowInTaskbar(Self, Value);
|
||||
end;
|
||||
end;
|
||||
|
||||
class procedure TCustomForm.WSRegisterClass;
|
||||
@ -2316,7 +2319,6 @@ begin
|
||||
|
||||
Assert(False, 'Trace:[TCustomForm.CreateWnd] FMenu.HandleNeeded');
|
||||
UpdateMenu;
|
||||
UpdateShowInTaskBar;
|
||||
|
||||
{$IFDEF OldAutoSize}
|
||||
// activate focus if visible
|
||||
@ -2453,6 +2455,7 @@ begin
|
||||
{$ENDIF}
|
||||
LCLIntf.SetFocus(FActiveControl.Handle);
|
||||
end;
|
||||
UpdateShowInTaskBar;
|
||||
end;
|
||||
{$ENDIF}
|
||||
end;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user