View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0039006||Lazarus||LCL||public||2021-06-15 01:01||2021-06-17 23:24|
|Reporter||jamie philbrook||Assigned To||Michl|
|Product Version||2.1 (SVN)|
|Fixed in Version||2.1 (SVN)|
|Summary||0039006: An invalid LM_WindowPosChanged is sent after a valid one causing double message traffic when a wincontrol moves or resizes.|
|Description||When processing the WM_WindowPosChanged message in a control a valid one is received and if the position or size has changed then the TWinControl.SendMoveSizeMessages emulates a WM_SIZE and WM_MOVE|
The problem, it also sends an invalid blank LM_WIndowPosCHanged using the
Perform(LM_WindowPosChanged, 0, 0); on line 4325 of the WinControl.inc file as of this writing.
as you can see, the last parameter is the Lparam and this is suppose to contain the Pointer to a WindowPos record.
So in turn, you need to add code to your own code to determine if this is valid or not and on top of all this, when moving or sizing the a control which includes the form too, you get double of message traffic in the class.
I took my local copy, commented that line and rebuild , my code works fine and not only that I see a improvement with sizing and moving controls
|Steps To Reproduce||Add a message handler for LM_WindowPosChanged on your form and take note of the NIL pointer that you receive in the incoming message while moving or sizing.. |
|Tags||No tags attached.|
|Fixed in Revision||65258|
Thank you for finding this! Yes, I can see it.
I've checked where the code comes from. It was moved in revision 1389 from control.inc TControl.ChangeBounds. There it was since the initial commit.
I've checked Win32 (Windows 7), Gtk2 and Qt5 (Linux Mint Cinnamon) and everything seems to work without this extra call. Maybe the code has improved since then or I miss the point or widgetset. As Lazarus 2.2.0 is tagged, let's test it in the wild. Hope it doesn't break anything.
Commited in Lazarus Trunk revision 65258. Please test and close if OK.
|2021-06-15 01:01||jamie philbrook||New Issue|
|2021-06-17 18:45||Michl||Assigned To||=> Michl|
|2021-06-17 18:45||Michl||Status||new => assigned|
|2021-06-17 19:05||Michl||Status||assigned => resolved|
|2021-06-17 19:05||Michl||Resolution||open => fixed|
|2021-06-17 19:05||Michl||Fixed in Version||=> 2.1 (SVN)|
|2021-06-17 19:05||Michl||Fixed in Revision||=> 65258|
|2021-06-17 19:05||Michl||LazTarget||=> -|
|2021-06-17 19:05||Michl||Note Added: 0131363|
|2021-06-17 23:24||jamie philbrook||Status||resolved => closed|
|2021-06-17 23:24||jamie philbrook||Note Added: 0131371|