From ca1ca23d451007cd1e6d0636f912bfa7afd6d12f Mon Sep 17 00:00:00 2001 From: Graeme Geldenhuys Date: Thu, 9 Aug 2012 18:04:14 +0100 Subject: bugfix: gdi fullscreen - form was larger than screen dimensions. This went unnoticed for a very long time, Mhen a from was set to fullscreen, after it was already displayed (not at creation time), then the size of the form was slightly bigger that the screen resolution. I corrected the Win32 API calls, and now the form has the correct size at all times. --- src/corelib/gdi/fpg_gdi.pas | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/corelib') diff --git a/src/corelib/gdi/fpg_gdi.pas b/src/corelib/gdi/fpg_gdi.pas index d5e2bf19..57dfba7c 100644 --- a/src/corelib/gdi/fpg_gdi.pas +++ b/src/corelib/gdi/fpg_gdi.pas @@ -1632,6 +1632,7 @@ begin UpdateWindowPosition; FWinStyle := WS_POPUP or WS_SYSMENU; + FWinStyle := FWinStyle and not(WS_CAPTION or WS_THICKFRAME); if aUpdate then begin @@ -1640,12 +1641,11 @@ begin {$ELSE} SetWindowLong(FWinHandle, GWL_STYLE, FWinStyle); {$ENDIF} - {According to MSDN, call SetWindowPos to apply changes made by SetWindowLong. - uFlags should be SWP_NOMOVE, SWP_NOSIZE, SWP_NOZORDER, SWP_FRAMECHANGED} - SetWindowPos(FWinHandle,0,0,0,0,0,SWP_NOMOVE or SWP_NOSIZE or SWP_NOZORDER or SWP_FRAMECHANGED); - ShowWindow(FWinHandle, SW_SHOW); + { According to MSDN, call SetWindowPos to apply changes made by SetWindowLong. } + SetWindowPos(FWinHandle,HWND_TOP,0,0,Width,Height,SWP_FRAMECHANGED or SWP_SHOWWINDOW or SWP_NOACTIVATE); end; - end else + end + else begin FWinStyle := FNonFullscreenStyle; if aUpdate then -- cgit v1.2.3-70-g09d2