For Windows there is a inconsistency in the use of wsFullScreen for WindowState
Original Reporter info from Mantis: SergeAnvarov @SergeAnvarov
-
Reporter name: Serge Anvarov
Original Reporter info from Mantis: SergeAnvarov @SergeAnvarov
- Reporter name: Serge Anvarov
Description:
wsFullScreen acts as wsNormal or as wsMaximized in different cases.
In Win32WinApi.inc it equal wsMaximized:
[code]
function TWin32WidgetSet.ShowWindow(hWnd: HWND; nCmdShow: Integer): Boolean;
begin
if nCmdShow = SW_SHOWFULLSCREEN then
nCmdShow := SW_SHOWMAXIMIZED;
Result := Boolean(Windows.ShowWindow(hWnd, nCmdShow));
end;
[/code]
but in Win32WSForms.pp it equal wsNormal:
[code]
class procedure TWin32WSCustomForm.ShowHide(const AWinControl: TWinControl);
const
WindowStateToFlags: array[TWindowState] of DWord = (
{ wsNormal } SW_SHOWNORMAL, // to restore from minimzed/maximized we need to use SW_SHOWNORMAL instead of SW_SHOW
{ wsMinimized } SW_SHOWMINIMIZED,
{ wsMaximized } SW_SHOWMAXIMIZED,
{ wsFullScreen } SW_SHOWNORMAL // win32 has no fullscreen window state
);
[/code]
I think the ShowHide needs to be changed to match the ShowWindow (replace last SW_SHOWNORMAL to SW_SHOWMAXIMIZED in ShowHide)
Steps to reproduce:
Create new project. Set Form1.WindowState = wsFullScreen. Run. Form will be maximized size but in design position. Stop. Set Form1.WindowState = wsMaximized. Run. Form will be maximized size in position 0,0.
Additional information:
Patch included
Mantis conversion info:
- Mantis ID: 34759
- Platform: Windows
- Version: 2.0RC3
- Fixed in revision: r62835 (#33d370e3)