diff options
| author | 2025-07-12 07:10:03 -0400 | |
|---|---|---|
| committer | 2025-07-12 07:10:03 -0400 | |
| commit | 687ff0da846f1fe52c3c7d08725612e782a8ac3a (patch) | |
| tree | 84eaf8f8afb488ba1f2d7030e7cac5701fd1e69e /src/osd/modules/debugger/win/debugwininfo.cpp | |
| parent | 6370d086226b4f5bc0e0a46f1e58ec1a03fa2b15 (diff) | |
Windows: Do not drop into debugger when no MAME window has focus (#13902)
On Windows, the debugger has a special Windows-specific feature that drops the user into the debugger if the key sequence is pressed. This seems to be present so that the key sequence triggers dropping into the debugger not just from the main window, but also from debugger windows.
This has also created an oddity where pressing the debugger key sequence from a MAME window will cause a "User-initiated break" but pressing it from a debugger window will cause "Internal breakpoint" to be displayed.
However, while this logic has a check to not apply when to a MAME window, it seems to also activate even if MAME itself is not in focus. This change ensures that a stray debugger sequence in a completely unrelated application won't cause the user to be dropped in the debugger.
Diffstat (limited to 'src/osd/modules/debugger/win/debugwininfo.cpp')
| -rw-r--r-- | src/osd/modules/debugger/win/debugwininfo.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
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; |
