Regression: TForm.OnResize not firing while form size is dragged
- Lazarus/FPC Version: Lazarus 2.3.0 (rev main-2_3-1020-g9f5c92c0) FPC 3.2.2 i386-win32-win32/win64, or Laz 2.2.0
- Operating System: Windows 11, no issue with Linux gtk2/qt5 (did not test others).
- CPU / Bitness: 32 or 64 bit - does not matter.
What happens
The form's OnResize event does not fire any more while the size of the form is changed by dragging the form corner with the mouse. The event fires only once when the mouse button is released.
As a consequence a control on the form which should resize by code in the OnResize handler does not follow the form's size - see attached demo.
What did you expect
OnResize should fire while the mouse is dragged. This is the behaviour seen in Delphi and with Lazarus versions < 2.2.
Steps to reproduce
The attached demo contains two panels. In the OnResize handler of the form the first panel is resized to occupy the left half and the seconds panel to occupy the right half of the form. When the edge of the form is dragged the panels do not change, only when the mouse button is release the panels adjust to the requested size.
In Laz 2.0.x or older, and in Delphi, the panels follow the form instantly.
Additional information
Bisecting the recent commit I found that the issue is caused by commit
"aa96e177 * Revert r63888 #54661a2a. It breaks event handling of forms with parent. Issue #36127 (closed)." by Juha, on April 13, 2021.
This commit reverts some changes, but if I manually reintroduce the changes made to win32callback.inc the issue is gone.