From 05f1f285caaf3b36c40a43cfd4bcb1421d098744 Mon Sep 17 00:00:00 2001 From: zeljko Date: Sat, 15 May 2010 21:27:29 +0000 Subject: [PATCH] Qt: fixed proper restoring of forms in AppRestore (eg. maximized forms) git-svn-id: trunk@25449 - --- lcl/interfaces/qt/qtint.pp | 3 +-- lcl/interfaces/qt/qtobject.inc | 20 ++++++++++++-------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/lcl/interfaces/qt/qtint.pp b/lcl/interfaces/qt/qtint.pp index 9d08677bbb..9056d76571 100644 --- a/lcl/interfaces/qt/qtint.pp +++ b/lcl/interfaces/qt/qtint.pp @@ -65,8 +65,7 @@ type // global hooks FAppEvenFilterHook: QObject_hookH; FAppFocusChangedHook: QApplication_hookH; - - FOldFocusWidget: QWidgetH; + FDockImage: QRubberBandH; FDragImageList: QWidgetH; FDragHotSpot: TPoint; diff --git a/lcl/interfaces/qt/qtobject.inc b/lcl/interfaces/qt/qtobject.inc index 24d45f62a5..5125884378 100644 --- a/lcl/interfaces/qt/qtobject.inc +++ b/lcl/interfaces/qt/qtobject.inc @@ -121,8 +121,6 @@ var begin WakeMainThread := @OnWakeMainThread; - FOldFocusWidget := nil; - { check whether this hook crashes on linux & darwin and why it is so we need this hook to catch release messages @@ -220,6 +218,7 @@ procedure TQtWidgetSet.AppMinimize; var i: Integer; AForm: TCustomForm; + States: QtWindowStates; {$ENDIF} begin if (Application.MainForm <> nil) and (Application.MainForm.HandleAllocated) then @@ -236,9 +235,11 @@ begin ) and not (AForm.FormStyle in [fsMDIChild, fsSplash]) and - not (AForm.BorderStyle in [bsNone]) - then - TQtMainWindow(AForm.Handle).ShowMinimized; + not (AForm.BorderStyle in [bsNone]) then + begin + States := TQtMainWindow(AForm.Handle).getWindowState; + TQtMainWindow(AForm.Handle).setWindowState(States or QtWindowMinimized); + end; end; {$ELSE} TQtMainWindow(Application.MainForm.Handle).ShowMinimized; @@ -251,6 +252,7 @@ procedure TQtWidgetSet.AppRestore; var i: Integer; AForm: TCustomForm; + States: QtWindowStates; {$ENDIF} begin if (Application.MainForm <> nil) and (Application.MainForm.HandleAllocated) then @@ -268,9 +270,11 @@ begin ) and not (AForm.FormStyle in [fsMDIChild, fsSplash]) and - not (AForm.BorderStyle in [bsNone]) - then - TQtMainWindow(AForm.Handle).ShowNormal; + not (AForm.BorderStyle in [bsNone]) then + begin + States := TQtMainWindow(AForm.Handle).getWindowState; + TQtMainWindow(AForm.Handle).setWindowState(States and not QtWindowMinimized); + end; end; {$ELSE} TQtMainWindow(Application.MainForm.Handle).ShowNormal;