Skip to content

Commit

Permalink
Focus debugger console after the target has stopped. Fix Vector35#411
Browse files Browse the repository at this point in the history
  • Loading branch information
xusheng6 committed Jun 19, 2023
1 parent 3264540 commit 7438fb1
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
17 changes: 17 additions & 0 deletions ui/ui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1039,6 +1039,22 @@ void DebuggerUI::navigateToCurrentIP()
}


void DebuggerUI::checkFocusDebuggerConsole()
{
auto context = UIContext::activeContext();
if (!context)
return;

auto globalArea = context->globalArea();
if (!globalArea)
return;

auto widget = globalArea->widget("Debugger Console");
if (widget)
globalArea->focusWidget("Debugger Console");
}


void DebuggerUI::updateUI(const DebuggerEvent& event)
{
switch (event.type)
Expand Down Expand Up @@ -1121,6 +1137,7 @@ void DebuggerUI::updateUI(const DebuggerEvent& event)
}

updateIPHighlight();
checkFocusDebuggerConsole();
break;
}

Expand Down
1 change: 1 addition & 0 deletions ui/ui.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ class DebuggerUI : public QObject
void openDebuggerSideBar(ViewFrame* frame = nullptr);
void updateIPHighlight();
void navigateToCurrentIP();
void checkFocusDebuggerConsole();

signals:
void debuggerEvent(const DebuggerEvent& event);
Expand Down

0 comments on commit 7438fb1

Please sign in to comment.