View Issue Details

IDProjectCategoryView StatusLast Update
0039006LazarusLCLpublic2021-06-17 23:24
Reporterjamie philbrook Assigned ToMichl  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version2.1 (SVN) 
Fixed in Version2.1 (SVN) 
Summary0039006: An invalid LM_WindowPosChanged is sent after a valid one causing double message traffic when a wincontrol moves or resizes.
DescriptionWhen 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 ReproduceAdd 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..
TagsNo tags attached.
Fixed in Revision65258
LazTarget-
Widgetset
Attached Files

Activities

Michl

2021-06-17 19:05

developer   ~0131363

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.

jamie philbrook

2021-06-17 23:24

reporter   ~0131371

fixed

Issue History

Date Modified Username Field Change
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