[Patch] TForm's bounds and restored bounds are inconsistent
Original Reporter info from Mantis: biloky @biloky
-
Reporter name: Joeny Ang
Original Reporter info from Mantis: biloky @biloky
- Reporter name: Joeny Ang
Description:
The attached patch tries to fix the following issues:
When form is designed with WindowState=wsMaximized:
- Restored dimension is wrong (related to #27894 (closed), #22771 (closed), #27375 (closed))
- Width/Height in OnShow() and OnActivate() events are wrong (related to #21119 (closed))
Under Delphi 3:
- OnCreate(): design time restored width/height
- OnShow() and OnActivate(): maximized width/height
When form's WindowsState=not maximized
3. Restored bounds in OnResize() and OnChangeBounds() events are wrong or not updated (related to #32631 (closed))
Note: Expanded on the idea of Yuichiro Takahashi from Issue #8576 (closed) to use Application.QueueAsyncCall() to "queue" the procedure to update the restored values, to the main event loop, thus delaying it until the form is properly moved or resized. The first calls to OnShow() and OnActivate() are also moved to this procedure so that querying Width/Height during these events will return the correct values.
Tested on GTK2 and Win32.
Mantis conversion info:
- Mantis ID: 36127
- OS: Arch Linux
- Platform: x86_64
- Version: 2.0.4
- Fixed in revision: r61997 (#a5cca7c6), r62113 (#106e142a), r63218 (#2bdfd2f6), r63577 (#1edc4cf4), r63842 (#475bc75d), r63888 (#54661a2a), r64986 (#aa96e177), r65213 (#595fb2c2), r65228 (#a078714f)
- Monitored by: » dezlov (Denis Kozlov), » @zamtmn (Andrey Zubarev), » @bonmario (Mario Bonati)