diff --git a/debugger/frames/debugger_general_options.pas b/debugger/frames/debugger_general_options.pas index 1c6649a6c0..dab943feee 100644 --- a/debugger/frames/debugger_general_options.pas +++ b/debugger/frames/debugger_general_options.pas @@ -93,6 +93,7 @@ begin gcbDebuggerGeneralOptions.Checked[3] := DebuggerAutoCloseAsm; gcbDebuggerGeneralOptions.Checked[4] := DebuggerAutoSetInstanceFromClass; gcbDebuggerGeneralOptions.Checked[5] := DebuggerAllowFunctionCalls; + gcbDebuggerGeneralOptions.Checked[6] := DebuggerOptions.AlwaysBringDbgDialogsToFront; end; txtAdditionalPath.Text:=EnvironmentOptions.GetParsedDebuggerSearchPath; end; @@ -117,6 +118,7 @@ begin gcbDebuggerGeneralOptions.Items.Add(lisDebugOptionsFrmAutoCloseAsm); // 3 auto close asm gcbDebuggerGeneralOptions.Items.Add(lisDebugOptionsFrmAutoInstanceClass); // 4 auto set class-from-instance gcbDebuggerGeneralOptions.Items.Add(lisDebugOptionsFrmAllowFunctionCalls); // 5 allow function calls + gcbDebuggerGeneralOptions.Items.Add(lisDebugOptionsFrmDialogsToFront); // 6 bring dialogs to front end; procedure TDebuggerGeneralOptionsFrame.ReadSettings(AOptions: TAbstractIDEOptions); @@ -141,6 +143,7 @@ begin DebuggerAutoCloseAsm := gcbDebuggerGeneralOptions.Checked[3]; DebuggerAutoSetInstanceFromClass := gcbDebuggerGeneralOptions.Checked[4]; DebuggerAllowFunctionCalls := gcbDebuggerGeneralOptions.Checked[5]; + DebuggerOptions.AlwaysBringDbgDialogsToFront := gcbDebuggerGeneralOptions.Checked[6]; end; end; diff --git a/ide/debugmanager.pas b/ide/debugmanager.pas index 4a5206bd5c..6bc19ed2c7 100644 --- a/ide/debugmanager.pas +++ b/ide/debugmanager.pas @@ -1802,6 +1802,7 @@ const ); var CurDialog: TDebuggerDlg; + AW: HWND; begin if Destroying then exit; if (ADialogType = ddtPseudoTerminal) and not HasConsoleSupport @@ -1868,7 +1869,10 @@ begin if Show then begin CurDialog.BeginUpdate; - IDEWindowCreators.ShowForm(CurDialog,BringToFront,vmOnlyMoveOffScreenToVisible); + AW := GetActiveWindow; + IDEWindowCreators.ShowForm(CurDialog,BringToFront or DebuggerOptions.AlwaysBringDbgDialogsToFront,vmOnlyMoveOffScreenToVisible); + if (not BringToFront) and DebuggerOptions.AlwaysBringDbgDialogsToFront then + SetActiveWindow(AW); CurDialog.EndUpdate; end; end; diff --git a/ide/lazarusidestrconsts.pas b/ide/lazarusidestrconsts.pas index fa0bdcb678..7815d7f97b 100644 --- a/ide/lazarusidestrconsts.pas +++ b/ide/lazarusidestrconsts.pas @@ -5332,6 +5332,7 @@ resourcestring lisDebugOptionsFrmAutoCloseAsm = 'Automatically close the assembler window, after source not found'; lisDebugOptionsFrmAutoInstanceClass = 'Automatically set "use instance class type" for new watches'; lisDebugOptionsFrmAllowFunctionCalls = 'BETA: Allow function calls in watches (if supported by backend)'; + lisDebugOptionsFrmDialogsToFront = 'Always bring debug-windows (watches, locals) to front when adding items'; lisDebugOptionsFrmDebuggerSpecific = 'Debugger specific options (depends on ' +'type of debugger)'; lisDebugOptionsFrmEventLog = 'Event Log'; diff --git a/ide/packages/idedebugger/idedebuggeropts.pas b/ide/packages/idedebugger/idedebuggeropts.pas index 8ea8edc41f..05bb23eee5 100644 --- a/ide/packages/idedebugger/idedebuggeropts.pas +++ b/ide/packages/idedebugger/idedebuggeropts.pas @@ -121,6 +121,7 @@ type *) DebuggerOptsVersionFpDebugUpdate = 1; private + FAlwaysBringDbgDialogsToFront: boolean; FBreakpointsDialogShowTree: TBreakpointsDialogShowTreeType; FFilename: string; FFileVersion: integer; @@ -175,6 +176,7 @@ type published property SetupCheckIgnoreNoDefault: Boolean read FSetupCheckIgnoreNoDefault write FSetupCheckIgnoreNoDefault; property BreakpointsDialogShowTree: TBreakpointsDialogShowTreeType read FBreakpointsDialogShowTree write FBreakpointsDialogShowTree default bstBrkGroup; + property AlwaysBringDbgDialogsToFront: boolean read FAlwaysBringDbgDialogsToFront write FAlwaysBringDbgDialogsToFront default true; end; TCurrentDebuggerSetupResult = ( @@ -835,6 +837,7 @@ procedure TDebuggerOptions.Init; begin // Init for all published values FBreakpointsDialogShowTree := bstBrkGroup; + FAlwaysBringDbgDialogsToFront := True; end; procedure TDebuggerOptions.Load;