On Ubuntu 22.04 with Lazarus 3.8 and gtk2 widgetset, I have some (not all) forms which I cannot set programmatically to some width + height value. The code in OnShow is simple:
procedure TMyForm.FormShow(Sender: TObject);
begin
Width := WidthFromPreviousSetting; // 1000
Height := HeightFromPreviousSetting; // 500
end;
I can see the form is resized for a millisecond to 1000 x 500, and then magically the OnResize event is fired where I can see the width and height are both reset to their design-time-values 600 x 300.
In the same millisecond of that magic OnResize call I see such a warning in the shell (I am starting the app from a shell):
"Pango-WARNING **: 19:37:46.261: Invalid UTF-8 string passed to pango_layout_set_text()
I already googled around and found a few hints to form properties, so here they are:
- AutoSize is False
- BorderIcons is biMaximize, biMinimize, biSystemMenu
- BorderStyle is bsSizable
- Constraints.Min/MaxWidth are 0
- Constraints.Min/MaxHeight are 0
- FormStyle is fsNormal
- Position is poMainFormCenter (tested all other values - does not make any difference)
- Scaled is True
- WindowState is wsNormal
This never happens in the main form, only in forms created within the running app.
The forms are converted by hand from a Delphi application. I have the gutt feeling I am overseeing some important thing.