TForm RestoredWidth and RestoredHeight updated incorrectly if window maximized under Gtk2
Original Reporter info from Mantis: chronos
-
Reporter name:
Original Reporter info from Mantis: chronos
- Reporter name:
Description:
There is a problem that RestoredWidth and RestoredHeight is updated to maximized form size if form is maximized. These values have to keep original dimensions from normal state to be able to restore maximized form back to normal state to original size. This works correctly under Windows but with Gtk2 which simulate LM_SIZE is working incorrectly.
Steps to reproduce:
Run attached demo on Linux with Gtk2 and switch between normal and maximized state and see how RestoredWidth and RestoredHeight is changed after maximization.
Additional information:
Not sure how to fix this. Code which updates FRestoredWidth is located at end of method TCustomForm.WMSize at customform.inc.
LM_SIZE is sent from gtk2proc.inc file from SendSizeNotificationToLCL function "if WidthHeightChanged then begin" section.
It seems that WindowState and size is not updated in right order so maximized size is sent with normal window state and not with maximize window state as should.
There is also gtk2WSDelayedWindowStateChange function in Gtk2WSForms.pp and as name suggests window state is sent as delayed which with SendSizeNotificationToLCL is apparently problem.