mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-07-03 00:38:24 +02:00
Qt: fixed proper restoring of forms in AppRestore (eg. maximized forms)
git-svn-id: trunk@25449 -
This commit is contained in:
parent
efdcd83830
commit
05f1f285ca
@ -65,8 +65,7 @@ type
|
||||
// global hooks
|
||||
FAppEvenFilterHook: QObject_hookH;
|
||||
FAppFocusChangedHook: QApplication_hookH;
|
||||
|
||||
FOldFocusWidget: QWidgetH;
|
||||
|
||||
FDockImage: QRubberBandH;
|
||||
FDragImageList: QWidgetH;
|
||||
FDragHotSpot: TPoint;
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user