Gtk2: Gtk2WSCustomPanel respect TCustomPanel.Visible property when creating handle. issue #23940

git-svn-id: trunk@40371 -
This commit is contained in:
zeljko 2013-02-23 13:51:00 +00:00
parent a8b657b971
commit 35b60c2c6c

View File

@ -241,6 +241,12 @@ begin
//debugln(['TGtk2WSCustomPanel.CreateHandle Frame^.allocation=',dbgs(Frame^.allocation),' WidgetClient^.allocation=',dbgs(WidgetClient^.allocation)]);
Set_RC_Name(AWinControl, Frame);
// issue #23940. Hide panel if we are not visible, but before setting callbacks.
// so it won't trigger unnecessary events to LCL.
if not AWinControl.Visible and not (csDesigning in AWinControl.ComponentState) then
gtk_widget_hide(Frame);
SetCallbacks(Frame, WidgetInfo);
Result := TLCLIntfHandle({%H-}PtrUInt(Frame));