View Issue Details

IDProjectCategoryView StatusLast Update
0037647LazarusLCLpublic2020-08-31 06:45
ReporterPaweł Dmitruk Assigned ToJuha Manninen  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version2.1 (SVN) 
Summary0037647: It does not raise an OnShow event if the form is maximized and ... - since rev 63577 (changed from 62892)
DescriptionIt does not raise an OnShow event if the form is maximized and Form:
top: -8
left: -8
width: Screen.Width
height: Screen.WorkAreaHeight-GetSystemMetrics(SM_CYCAPTION);

tested on Windows 10

exaple code:

procedure TForm1.FormCreate(Sender: TObject);
begin
  Top := -8;
  Left := -8;
  Width := Screen.Width;
  Height := Screen.WorkAreaHeight-GetSystemMetrics(SM_CYCAPTION);
  Windowstate := wsMaximized;
end;

procedure TForm1.FormShow(Sender: TObject);
begin
  ShowMessage('OnShow');
end;
TagsNo tags attached.
Fixed in Revisionr63847
LazTarget-
WidgetsetWin32/Win64
Attached Files

Relationships

related to 0036127 resolvedJuha Manninen [Patch] TForm's bounds and restored bounds are inconsistent 

Activities

Juha Manninen

2020-08-29 15:42

developer   ~0125200

Last edited: 2020-08-29 15:44

View 2 revisions

r62892 :
   if FIsFirstOnActivate then
   begin
       FIsFirstOnActivate := False;
- Activate;
+ if FActive then
+ Activate;
     end;
   end;
   FDelayedWMMove := False;

Could it be that FActive is not set on Windows when Top and Left < 0?

Paweł Dmitruk

2020-08-29 16:04

reporter   ~0125201

Last edited: 2020-08-29 16:08

View 2 revisions

sorry for the mistake, it was for revision 63577
the error occurs only when left and top are equal to -8, if they are another numbers (even negative) then the OnShow event is dispatched

Juha Manninen

2020-08-29 17:27

developer   ~0125204

Last edited: 2020-08-29 17:28

View 2 revisions

Ok, I changed the summary and updated related issues.

Indeed all of this is needed to reproduce the bug :
  Top := -8;
  Left := -8;
  Width := Screen.Width;
  Height := Screen.WorkAreaHeight-GetSystemMetrics(SM_CYCAPTION);
  Windowstate := wsMaximized;

Strange. BTW, why do you need all those lines? Isn't Windowstate := wsMaximized enough?

Paweł Dmitruk

2020-08-29 20:36

reporter   ~0125206

Uses the TXMLPropStorage component, in which it remembers, among others, the given properties (Left, Top, Width, Height, WindowsState).
And since this is not a bug of this component, I wrote a case that causes this error.

Juha Manninen

2020-08-30 00:10

developer   ~0125210

What uses TXMLPropStorage component? I didn't understand.

Paweł Dmitruk

2020-08-30 15:09

reporter   ~0125217

sorry but my english is not good.
I use this component in my applications. An example in the attachment:
- compile and run,
- maximize the window.
- close
- run again
project1.zip (109,669 bytes)

Juha Manninen

2020-08-30 22:36

developer   ~0125225

Fixed, please test.
The difference must come from Windows itself. With the specific condition (Top, Left = -8 etc.) there are less events or they are in different order.
TCustomForm.FormIsUpdating returns then True always in CheckOnChangeBounds and the flag for delayed ChangeBounds is not set.
My change seems to work with all widgetsets I tested.

Paweł Dmitruk

2020-08-31 06:45

reporter   ~0125230

Now is ok, thank you very much

Issue History

Date Modified Username Field Change
2020-08-27 11:21 Paweł Dmitruk New Issue
2020-08-29 15:36 Juha Manninen Relationship added related to 0036877
2020-08-29 15:42 Juha Manninen Note Added: 0125200
2020-08-29 15:44 Juha Manninen Note Edited: 0125200 View Revisions
2020-08-29 15:46 Juha Manninen Relationship added related to 0036127
2020-08-29 16:04 Paweł Dmitruk Note Added: 0125201
2020-08-29 16:08 Paweł Dmitruk Note Edited: 0125201 View Revisions
2020-08-29 17:11 Juha Manninen Relationship deleted related to 0036877
2020-08-29 17:12 Juha Manninen Summary It does not raise an OnShow event if the form is maximized and ... - since rev 62892 => It does not raise an OnShow event if the form is maximized and ... - since rev 63577 (changed from 62892)
2020-08-29 17:12 Juha Manninen LazTarget => -
2020-08-29 17:12 Juha Manninen Widgetset Win32/Win64 => Win32/Win64
2020-08-29 17:27 Juha Manninen Note Added: 0125204
2020-08-29 17:28 Juha Manninen Note Edited: 0125204 View Revisions
2020-08-29 20:36 Paweł Dmitruk Note Added: 0125206
2020-08-30 00:10 Juha Manninen Note Added: 0125210
2020-08-30 15:09 Paweł Dmitruk Note Added: 0125217
2020-08-30 15:09 Paweł Dmitruk File Added: project1.zip
2020-08-30 22:36 Juha Manninen Assigned To => Juha Manninen
2020-08-30 22:36 Juha Manninen Status new => resolved
2020-08-30 22:36 Juha Manninen Resolution open => fixed
2020-08-30 22:36 Juha Manninen Fixed in Revision => r63847
2020-08-30 22:36 Juha Manninen Widgetset Win32/Win64 => Win32/Win64
2020-08-30 22:36 Juha Manninen Note Added: 0125225
2020-08-31 06:45 Paweł Dmitruk Status resolved => closed
2020-08-31 06:45 Paweł Dmitruk Note Added: 0125230