mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-07-04 08:18:53 +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
@ -66,7 +66,6 @@ type
|
|||||||
FAppEvenFilterHook: QObject_hookH;
|
FAppEvenFilterHook: QObject_hookH;
|
||||||
FAppFocusChangedHook: QApplication_hookH;
|
FAppFocusChangedHook: QApplication_hookH;
|
||||||
|
|
||||||
FOldFocusWidget: QWidgetH;
|
|
||||||
FDockImage: QRubberBandH;
|
FDockImage: QRubberBandH;
|
||||||
FDragImageList: QWidgetH;
|
FDragImageList: QWidgetH;
|
||||||
FDragHotSpot: TPoint;
|
FDragHotSpot: TPoint;
|
||||||
|
@ -121,8 +121,6 @@ var
|
|||||||
begin
|
begin
|
||||||
WakeMainThread := @OnWakeMainThread;
|
WakeMainThread := @OnWakeMainThread;
|
||||||
|
|
||||||
FOldFocusWidget := nil;
|
|
||||||
|
|
||||||
{
|
{
|
||||||
check whether this hook crashes on linux & darwin and why it is so
|
check whether this hook crashes on linux & darwin and why it is so
|
||||||
we need this hook to catch release messages
|
we need this hook to catch release messages
|
||||||
@ -220,6 +218,7 @@ procedure TQtWidgetSet.AppMinimize;
|
|||||||
var
|
var
|
||||||
i: Integer;
|
i: Integer;
|
||||||
AForm: TCustomForm;
|
AForm: TCustomForm;
|
||||||
|
States: QtWindowStates;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
begin
|
begin
|
||||||
if (Application.MainForm <> nil) and (Application.MainForm.HandleAllocated) then
|
if (Application.MainForm <> nil) and (Application.MainForm.HandleAllocated) then
|
||||||
@ -236,9 +235,11 @@ begin
|
|||||||
)
|
)
|
||||||
and
|
and
|
||||||
not (AForm.FormStyle in [fsMDIChild, fsSplash]) and
|
not (AForm.FormStyle in [fsMDIChild, fsSplash]) and
|
||||||
not (AForm.BorderStyle in [bsNone])
|
not (AForm.BorderStyle in [bsNone]) then
|
||||||
then
|
begin
|
||||||
TQtMainWindow(AForm.Handle).ShowMinimized;
|
States := TQtMainWindow(AForm.Handle).getWindowState;
|
||||||
|
TQtMainWindow(AForm.Handle).setWindowState(States or QtWindowMinimized);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
{$ELSE}
|
{$ELSE}
|
||||||
TQtMainWindow(Application.MainForm.Handle).ShowMinimized;
|
TQtMainWindow(Application.MainForm.Handle).ShowMinimized;
|
||||||
@ -251,6 +252,7 @@ procedure TQtWidgetSet.AppRestore;
|
|||||||
var
|
var
|
||||||
i: Integer;
|
i: Integer;
|
||||||
AForm: TCustomForm;
|
AForm: TCustomForm;
|
||||||
|
States: QtWindowStates;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
begin
|
begin
|
||||||
if (Application.MainForm <> nil) and (Application.MainForm.HandleAllocated) then
|
if (Application.MainForm <> nil) and (Application.MainForm.HandleAllocated) then
|
||||||
@ -268,9 +270,11 @@ begin
|
|||||||
)
|
)
|
||||||
and
|
and
|
||||||
not (AForm.FormStyle in [fsMDIChild, fsSplash]) and
|
not (AForm.FormStyle in [fsMDIChild, fsSplash]) and
|
||||||
not (AForm.BorderStyle in [bsNone])
|
not (AForm.BorderStyle in [bsNone]) then
|
||||||
then
|
begin
|
||||||
TQtMainWindow(AForm.Handle).ShowNormal;
|
States := TQtMainWindow(AForm.Handle).getWindowState;
|
||||||
|
TQtMainWindow(AForm.Handle).setWindowState(States and not QtWindowMinimized);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
{$ELSE}
|
{$ELSE}
|
||||||
TQtMainWindow(Application.MainForm.Handle).ShowNormal;
|
TQtMainWindow(Application.MainForm.Handle).ShowNormal;
|
||||||
|
Loading…
Reference in New Issue
Block a user