From cf4f4331003f9ab4ab04953c144e9fcf70ac8691 Mon Sep 17 00:00:00 2001 From: paul Date: Mon, 26 Jan 2009 03:41:21 +0000 Subject: [PATCH] lcl: - skip forms which does not share application taskbar item from TApplication.UpdateVisible (bug #0013042) - don't perform any visual actions when we change ShowInTaskBar property in the design time git-svn-id: trunk@18445 - --- lcl/include/application.inc | 15 ++++++++++++--- lcl/include/customform.inc | 2 +- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/lcl/include/application.inc b/lcl/include/application.inc index 85127364b6..4caddcf4ea 100644 --- a/lcl/include/application.inc +++ b/lcl/include/application.inc @@ -825,22 +825,31 @@ end; ------------------------------------------------------------------------------} procedure TApplication.UpdateVisible; + function UseAppTaskbarItem(AForm: TCustomForm): Boolean; inline; + begin + Result := (AForm = MainForm) or (AForm.ShowInTaskBar in [stNever, stDefault]); + end; + function HasVisibleForms: Boolean; var i: integer; + AForm: TCustomForm; begin Result := False; for i := 0 to Screen.CustomFormCount - 1 do - if Screen.CustomForms[i].Visible and (Screen.CustomForms[i].Parent = nil) then + begin + AForm := Screen.CustomForms[i]; + if AForm.Visible and (AForm.Parent = nil) and UseAppTaskbarItem(AForm) then begin Result := True; break; end; + end; end; begin - // if there are visible forms then application task bar item must be visible too - // else hide it + // if there are visible forms wich shares application taskbar item then application + // task bar item must be visible too else hide it WidgetSet.AppSetVisible(HasVisibleForms); end; diff --git a/lcl/include/customform.inc b/lcl/include/customform.inc index 75f96abb8a..8001971a10 100644 --- a/lcl/include/customform.inc +++ b/lcl/include/customform.inc @@ -1418,7 +1418,7 @@ procedure TCustomForm.SetShowInTaskbar(Value: TShowInTaskbar); begin if Value = FShowInTaskbar then exit; FShowInTaskbar := Value; - if HandleAllocated then + if not (csDesigning in ComponentState) and HandleAllocated then TWSCustomFormClass(WidgetSetClass).SetShowInTaskbar(Self, Value); end;