From 72285efd2dce89542decc5e9c9652b5e541a57cd Mon Sep 17 00:00:00 2001 From: Alexey T Date: Fri, 19 Jul 2024 14:23:52 +0300 Subject: [PATCH] separate find-dlg on qt5: fixing #5496 --- app/formmain.pas | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/app/formmain.pas b/app/formmain.pas index 32db3396f34..aba6fe4fd55 100644 --- a/app/formmain.pas +++ b/app/formmain.pas @@ -749,6 +749,7 @@ TfmMain = class(TForm) FCmdlineFileCount: integer; FPrevJsonObj: TJSONData; FPrevFramesEditState: array of TFrameEditState; + FPrevFindDlgVisible: boolean; function CodeTreeFilter_OnFilterNode(ItemNode: TTreeNode; out Done: Boolean): Boolean; function ConfirmAllFramesAreSaved(AWithCancel: boolean): boolean; @@ -3235,6 +3236,12 @@ procedure TfmMain.AppPropsActivate(Sender: TObject); F.Editor.Update; end; + {$if defined(LCLQt5) or defined(LCLQt6)} + //workaround for issue https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/40933 + if FPrevFindDlgVisible and Assigned(fmFind) and not fmFind.Visible then + fmFind.Show; + {$ifend} + DoPyEvent_AppActivate(TAppPyEvent.OnAppActivate); end; @@ -3254,6 +3261,13 @@ procedure TfmMain.AppPropsDeactivate(Sender: TObject); CloseFormAutoCompletion; } + {$if defined(LCLQt5) or defined(LCLQt6)} + //workaround for issue https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/40933 + FPrevFindDlgVisible:= Assigned(fmFind) and (fmFind.Parent=nil) and fmFind.Visible; + if FPrevFindDlgVisible then + fmFind.Hide; + {$ifend} + DoPyEvent_AppActivate(TAppPyEvent.OnAppDeactivate); end;