From 997890a56d8430a4dae4f522850e36fecf623ba0 Mon Sep 17 00:00:00 2001 From: Aaron Giles Date: Fri, 21 Dec 2007 17:46:00 +0000 Subject: [PATCH] Fixed bug that would cause events to leak through to the game when the debugger was up. --- src/osd/windows/debugwin.c | 4 ++++ src/osd/windows/input.c | 24 ++++++++++++------------ 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/src/osd/windows/debugwin.c b/src/osd/windows/debugwin.c index 3a1a3c7a9f8..50b55e04b3c 100644 --- a/src/osd/windows/debugwin.c +++ b/src/osd/windows/debugwin.c @@ -26,6 +26,7 @@ #include "debugwin.h" #include "window.h" #include "video.h" +#include "input.h" #include "config.h" #include "strconv.h" #include "winutf8.h" @@ -265,6 +266,9 @@ void osd_wait_for_debugger(void) // make sure the debug windows are visible waiting_for_debugger = TRUE; smart_show_all(TRUE); + + // run input polling to ensure that our status is in sync + wininput_poll(); // get and process messages GetMessage(&message, NULL, 0, 0); diff --git a/src/osd/windows/input.c b/src/osd/windows/input.c index 5c7dc4d8c6f..aa591d55ebd 100644 --- a/src/osd/windows/input.c +++ b/src/osd/windows/input.c @@ -533,22 +533,22 @@ static void wininput_exit(running_machine *machine) void wininput_poll(void) { - int hasfocus = winwindow_has_focus(); + int hasfocus = winwindow_has_focus() && input_enabled; // ignore if not enabled - if (!input_enabled) - return; + if (input_enabled) + { + // remember when this happened + last_poll = GetTickCount(); - // remember when this happened - last_poll = GetTickCount(); + // periodically process events, in case they're not coming through + // this also will make sure the mouse state is up-to-date + winwindow_process_events_periodic(); - // periodically process events, in case they're not coming through - // this also will make sure the mouse state is up-to-date - winwindow_process_events_periodic(); - - // track if mouse/lightgun is enabled, for mouse hiding purposes - mouse_enabled = input_device_class_enabled(DEVICE_CLASS_MOUSE); - lightgun_enabled = input_device_class_enabled(DEVICE_CLASS_LIGHTGUN); + // track if mouse/lightgun is enabled, for mouse hiding purposes + mouse_enabled = input_device_class_enabled(DEVICE_CLASS_MOUSE); + lightgun_enabled = input_device_class_enabled(DEVICE_CLASS_LIGHTGUN); + } // poll all of the devices if (hasfocus)