Zero size form when dynamically created with borderstyle bsToolWindow
Original Reporter info from Mantis: Ocye
-
Reporter name: Heiko Tietze
Original Reporter info from Mantis: Ocye
- Reporter name: Heiko Tietze
Description:
Cannot say since when this bug happens but it is quite annoying. When I compile against Gtk2 the dynamically created forms have zero width (plus form decorations). With borderstyle bsToolSizeWin it works - but a confirmation dialog must not have those interactions.
The sample code works with Qt (although it can always be resized regardless the borderstyle) and crashes for some reason with customdrawn (didn't test this further). Gtk2 reports always the right size (320x240 when nothing is defined) but the form very tiny. I tried to disable/enable autosize, client aligned content or not, and all similar properties. No success.
Steps to reproduce:
New application with a button.
private
aForm: TForm;
aButton: TButton;
procedure DoCloseForm(Sender: TObject);
...
procedure TForm1.Button1Click(Sender: TObject);
begin
aForm:=TForm.Create(nil);
aForm.Parent:=nil;
aForm.BorderStyle:=bsToolWindow;//bsSizeToolWin;//
aButton:=TButton.Create(aForm);
aButton.Parent:=aForm;
aButton.Align:=alClient;
aButton.Caption:='Close';
aButton.OnClick:=@DoCloseForm;
aForm.SetBounds(10,10,100,100);
aForm.Show;
Caption:=inttostr(aForm.Left)+','+inttostr(aForm.Top)+','+inttostr(aForm.Width)+','+inttostr(aForm.Height); //-> 10,10,100,100
end;
procedure TForm1.DoCloseForm(Sender: TObject);
begin
aButton.Free;
aForm.Free;
end;
Additional information:
My system is KDE but the issue has been reported by a user as well for Mint (Gnome based). Windows and MacOS users didn't complain so it should work there.
Mantis conversion info:
- Mantis ID: 29347
- Build: Lazarus 1.7 r51083M FPC 3.0.0 x8
- Version: 1.5 (SVN)