DockedFormEditor trouble lazarus / 10-Designer ---------------------------------------------------------------------- alpine · 2022-12-18 10:05 Hello there, recently I am experiencing some strange effect in Lazarus docked form editor, here is what happens: https://youtu.be/XJne6V1WIps Lazarus 2.2.2 (rev lazarus_2_2_2) FPC 3.2.2 i386-win32-win32/win64 It seems the form editor enters an infinite loop recalculating the layout again and again because of the resize. It happens on some forms, on others it doesn't. I've tried to simulate this on a smaller scale (out of that project) but failed. Anyone experienced something similar? Any ideas what property can cause this? ---------------------------------------------------------------------- alpine · 2022-12-18 10:43 I think I found something: On a fresh new form it is enough to change the Form.Align property to something different than alNone and the form starts growing indefinitely. Also, when the form has BorderStyle of bsNone, resizing it gives an inexact result, see attached picture. ---------------------------------------------------------------------- KodeZwerg · 2022-12-19 08:09 Lazarus 2.2.4 (rev lazarus_2_2_4) FPC 3.2.2 x86_64-win64-win32/win64 I can confirm this behavior, as soon as you switch from alNone/alCustom to something stupid what you not should use for a mainform, the designer go crazy resizing all over. ---------------------------------------------------------------------- Manuel Santana · 2023-10-02 01:09 I have the same problem, but found out that is happening only on Windows. On Linux Mint Debian Edition 6 with same Lazarus version is not happening. ---------------------------------------------------------------------- n7800 · 2024-01-29 20:20 Quote from: alpine on December 18, 2022, 11:05:08 amHello there, recently I am experiencing some strange effect in Lazarus docked form editor, here is what happens: https://youtu.be/XJne6V1WIps Lazarus 2.2.2 (rev lazarus_2_2_2) FPC 3.2.2 i386-win32-win32/win64 It seems the form editor enters an infinite loop recalculating the layout again and again because of the resize. It happens on some forms, on others it doesn't. If this is still relevant to you, I would advise just opening this project in the new Lazarus 3.0. This issue may have already been fixed. ---------------------------------------------------------------------- n7800 · 2024-01-29 20:21 Quote from: alpine on December 18, 2022, 11:43:31 amI think I found something: On a fresh new form it is enough to change the Form.Align property to something different than alNone and the form starts growing indefinitely. Quote from: KodeZwerg on December 19, 2022, 09:09:35 amI can confirm this behavior, as soon as you switch from alNone/alCustom to something stupid what you not should use for a mainform, the designer go crazy resizing all over. I can confirm too, this still there in trunk (at least in win32 and gtk2). There is already an issue on the bug tracker https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/39884. ---------------------------------------------------------------------- n7800 · 2024-01-29 20:21 Quote from: alpine on December 18, 2022, 11:43:31 amAlso, when the form has BorderStyle of bsNone, resizing it gives an inexact result, see attached picture. This is no longer reproduced in the trunk - the bisection showed that this was fixed somewhere on 02-10-22 (there are several revisions that do not compile, so it is difficult to say which one fixed it). ---------------------------------------------------------------------- majolika · 2025-01-26 15:25 I found this topic and decided not to make the same one and post it here. Well... I think I found a bug in Docked Form Editor. First of all, I use Lazarus 3.8 with AnchorDockingDsgn and DockedFormEditor packeges incorporated. Windows 10. Here's the minimal steps to reproduce: 1. Create new project; 2. In the Form Designer place TPaintBox on an empty form; 3. Set AutoSize property of TForm to True by checking it in the Object Inspector. 4. Ka-boom! Steps 2 and 3 can be reversed and instead of TPaintBox it can be used another non-visual controls. Not all. For example, TOpenDialog doesn't cause any trouble but TImage, TShape — do. I didn't test all available controls but I hope three (TPaintBox, TImage, TShape) is enough to locate the bug. Some screenshots attached. I think that the bug is inside DockedFormEditor because if I remove this package and rebuild Lazarus I'm no longer able to reproduce it. It seems that the bug is Windows-related and not reproducable on Linux. ---------------------------------------------------------------------- n7800 · 2025-01-26 16:35 I confirm the error, please report it on the bug tracker, there is no such thing there yet. If you want, I can do it myself. The problem affects all descendants of the TGraphicControl (TLabel, TImage, TShape, ...) class, since they are all drawn on the surface of the parent. Non-visual components (which are displayed simply as an icon with a caption) are not located on the form - this is just their presentation at design time, so there is no problem with them, as well as with an empty form. It is noteworthy that if you set AutoSize for the form at runtime of the project, there will be no problem. This problem affects only the form editor (docked). ---------------------------------------------------------------------- majolika · 2025-01-26 17:00 Quote from: n7800 on January 26, 2025, 05:35:41 pmIf you want, I can do it myself. Please, do it yourself cause I'm not familiar with the bug tracker. QuoteNon-visual components Don't judge me too strong, I'm just a newbie who was lucky enough to catch a bug. QuoteIt is noteworthy that if you set AutoSize for the form at runtime of the project, there will be no problem.Oh, yes! I forgot to mention it. This is how I workaround this bug for now. ---------------------------------------------------------------------- n7800 · 2025-01-26 18:40 Issue created, thanks for the feedback. ---------------------------------------------------------------------- Martin_fr · 2025-01-26 18:46 There are 2 issues at hand. 1) A form in the designer should not autosize. That makes designing a lot harder. It only happens in the docked designer, not the normal designer. 2) https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/41367  (not the issue to fix the docked designer problem...) ---------------------------------------------------------------------- Martin_fr · 2025-01-27 12:47 Please test with https://gitlab.com/freepascal.org/lazarus/lazarus/- /commit/9b4c81b56ba012d4a3a146fe14a1fd03d41979f0 ---------------------------------------------------------------------- Martin_fr · 2025-01-27 12:50 Quote from: alpine on December 18, 2022, 11:43:31 amI think I found something: On a fresh new form it is enough to change the Form.Align property to something different than alNone and the form starts growing indefinitely. The image shows an older Lazarus => that should have been fixed in the RC already (if not even in 3.8 / not sure) QuoteAlso, when the form has BorderStyle of bsNone, resizing it gives an inexact result, see attached picture. Needs testing, and reporting if present in RC.