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;