From aff41a48b89173de8bb93e9ee9ae901f9578c0b5 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Wed, 7 May 2008 12:12:18 +0000 Subject: minor tweak to the GUI double click handling code svn-id: r31922 --- gui/newgui.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gui/newgui.cpp b/gui/newgui.cpp index 5e034b726c..0bf61d084f 100644 --- a/gui/newgui.cpp +++ b/gui/newgui.cpp @@ -219,6 +219,7 @@ void NewGui::runLoop() { Dialog *activeDialog = getTopDialog(); bool didSaveState = false; int button; + uint32 time; if (activeDialog == 0) return; @@ -252,7 +253,6 @@ void NewGui::runLoop() { _system->updateScreen(); Common::Event event; - uint32 time = _system->getMillis(); while (eventMan->pollEvent(event)) { if (activeDialog != getTopDialog() && event.type != Common::EVENT_QUIT && event.type != Common::EVENT_SCREEN_CHANGED) @@ -288,6 +288,7 @@ void NewGui::runLoop() { case Common::EVENT_LBUTTONDOWN: case Common::EVENT_RBUTTONDOWN: button = (event.type == Common::EVENT_LBUTTONDOWN ? 1 : 2); + time = _system->getMillis(); if (_lastClick.count && (time < _lastClick.time + kDoubleClickDelay) && ABS(_lastClick.x - event.mouse.x) < 3 && ABS(_lastClick.y - event.mouse.y) < 3) { -- cgit v1.2.3