diff options
author | alberth <alberth@openttd.org> | 2010-05-30 12:18:49 +0000 |
---|---|---|
committer | alberth <alberth@openttd.org> | 2010-05-30 12:18:49 +0000 |
commit | cf060d16eccc0ed125fc3a4c16794c068bba3584 (patch) | |
tree | bdddfb466f9628e36ccbbec35f42a585660daa76 /src | |
parent | ce0e1cbb3f69ab43d8c634c3bb0eb229a09f876d (diff) | |
download | openttd-cf060d16eccc0ed125fc3a4c16794c068bba3584.tar.xz |
(svn r19906) -Codechange: HandleMouseOver() never ends, so don't return an event handling state.
Diffstat (limited to 'src')
-rw-r--r-- | src/window.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/window.cpp b/src/window.cpp index fed8e5e0a..5779bd6f9 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -1406,7 +1406,8 @@ static EventState HandleMouseDrag() return ES_HANDLED; } -static bool HandleMouseOver() +/** Report position of the mouse to the underlying window. */ +static void HandleMouseOver() { Window *w = FindWindowFromPt(_cursor.pos.x, _cursor.pos.y); @@ -1426,9 +1427,6 @@ static bool HandleMouseOver() const NWidgetCore *widget = w->nested_root->GetWidgetFromPos(pt.x, pt.y); if (widget != NULL) w->OnMouseOver(pt, widget->index); } - - /* Mouseover never stops execution */ - return true; } /** @@ -2094,7 +2092,8 @@ static void MouseLoop(MouseClick click, int mousewheel) if (HandleWindowDragging() == ES_HANDLED) return; if (HandleScrollbarScrolling() == ES_HANDLED) return; if (HandleViewportScroll() == ES_HANDLED) return; - if (!HandleMouseOver()) return; + + HandleMouseOver(); bool scrollwheel_scrolling = _settings_client.gui.scrollwheel_scrolling == 1 && (_cursor.v_wheel != 0 || _cursor.h_wheel != 0); if (click == MC_NONE && mousewheel == 0 && !scrollwheel_scrolling) return; |