diff options
| -rw-r--r-- | src/osd/modules/debugger/debugwin.cpp | 18 | ||||
| -rw-r--r-- | src/osd/modules/debugger/win/debugwininfo.cpp | 8 | ||||
| -rw-r--r-- | src/osd/modules/debugger/win/debugwininfo.h | 1 |
3 files changed, 20 insertions, 7 deletions
diff --git a/src/osd/modules/debugger/debugwin.cpp b/src/osd/modules/debugger/debugwin.cpp index 8ff26d40fb3..9b2ef525e96 100644 --- a/src/osd/modules/debugger/debugwin.cpp +++ b/src/osd/modules/debugger/debugwin.cpp @@ -235,16 +235,20 @@ void debugger_windows::debugger_update() // if we're running live, do some checks if (!winwindow_has_focus() && m_machine && !m_machine->debugger().cpu().is_stopped() && (m_machine->phase() == machine_phase::RUNNING)) { - // see if the interrupt key is pressed and break if it is - if (seq_pressed()) + // check to see if a debugger window has focus + if (std::any_of(m_window_list.begin(), m_window_list.end(), [](auto const& window) { return window->has_focus(); })) { - HWND const focuswnd = GetFocus(); + // see if the interrupt key is pressed and break if it is + if (seq_pressed()) + { + HWND const focuswnd = GetFocus(); - m_machine->debugger().debug_break(); + m_machine->debugger().debug_break(); - // if we were focused on some window's edit box, reset it to default - for (auto &info : m_window_list) - info->restore_field(focuswnd); + // if we were focused on some window's edit box, reset it to default + for (auto& info : m_window_list) + info->restore_field(focuswnd); + } } } } diff --git a/src/osd/modules/debugger/win/debugwininfo.cpp b/src/osd/modules/debugger/win/debugwininfo.cpp index 6ed3c193bc0..76e45376555 100644 --- a/src/osd/modules/debugger/win/debugwininfo.cpp +++ b/src/osd/modules/debugger/win/debugwininfo.cpp @@ -81,6 +81,14 @@ void debugwin_info::destroy() DestroyWindow(m_wnd); } + +bool debugwin_info::has_focus() const +{ + HWND focus_hwnd = GetFocus(); + return m_wnd == focus_hwnd || IsChild(m_wnd, focus_hwnd); +} + + bool debugwin_info::set_default_focus() { return false; diff --git a/src/osd/modules/debugger/win/debugwininfo.h b/src/osd/modules/debugger/win/debugwininfo.h index dc9878dedea..0628d4aa0c9 100644 --- a/src/osd/modules/debugger/win/debugwininfo.h +++ b/src/osd/modules/debugger/win/debugwininfo.h @@ -43,6 +43,7 @@ public: void set_foreground() const { SetForegroundWindow(m_wnd); } void redraw(); void destroy(); + bool has_focus() const; virtual bool set_default_focus(); void prev_view(debugview_info *curview); |
