summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2019-02-21 23:53:16 +0000
committerCharles Pigott <charlespigott@googlemail.com>2019-02-22 21:32:12 +0000
commit56a6d7aec88b170eaf0dd57e14f5fffc24d3b1af (patch)
tree3ba1b28c425670275d0bc08f5438d67275f515a0
parent69928df3f05209462387018540cd2f1ceffdba27 (diff)
downloadopenttd-56a6d7aec88b170eaf0dd57e14f5fffc24d3b1af.tar.xz
Fix #7227: Don't apply mouse-hasn't-moved test to scrollbars.
-rw-r--r--src/window.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/window.cpp b/src/window.cpp
index 1729687f2..857029622 100644
--- a/src/window.cpp
+++ b/src/window.cpp
@@ -2436,14 +2436,14 @@ static EventState HandleActiveWidget()
return ES_HANDLED;
}
- /* If cursor hasn't moved, there is nothing to do. */
- if (_cursor.delta.x == 0 && _cursor.delta.y == 0) return ES_HANDLED;
-
/* Handle scrollbar internally, or dispatch click event */
WidgetType type = w->GetWidget<NWidgetBase>(w->mouse_capture_widget)->type;
if (type == NWID_VSCROLLBAR || type == NWID_HSCROLLBAR) {
HandleScrollbarScrolling(w);
} else {
+ /* If cursor hasn't moved, there is nothing to do. */
+ if (_cursor.delta.x == 0 && _cursor.delta.y == 0) return ES_HANDLED;
+
Point pt = { _cursor.pos.x - w->left, _cursor.pos.y - w->top };
w->OnClick(pt, w->mouse_capture_widget, 0);
}