summaryrefslogtreecommitdiff
path: root/src/window.cpp
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2010-01-28 02:31:37 +0000
committerpeter1138 <peter1138@openttd.org>2010-01-28 02:31:37 +0000
commit08a24fcc313dc5f5f71c38d10163589e267a6206 (patch)
tree9bdf40479bf7e15c24a2ac82d2238f58b3ed3ab0 /src/window.cpp
parent07b285c5ca3123050e55c78585ab0cbc051ce9e9 (diff)
downloadopenttd-08a24fcc313dc5f5f71c38d10163589e267a6206.tar.xz
(svn r18933) -Codechange: Don't constantly redraw a window when moving it unless it actually moves.
Diffstat (limited to 'src/window.cpp')
-rw-r--r--src/window.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/window.cpp b/src/window.cpp
index ee5b04093..f89c0abe1 100644
--- a/src/window.cpp
+++ b/src/window.cpp
@@ -1513,6 +1513,9 @@ static bool HandleWindowDragging()
/* Get out immediately if no window is being dragged at all. */
if (!_dragging_window) return true;
+ /* If button still down, but cursor hasn't moved, there is nothing to do. */
+ if (_left_button_down && _cursor.delta.x == 0 && _cursor.delta.y == 0) return false;
+
/* Otherwise find the window... */
Window *w;
FOR_ALL_WINDOWS_FROM_BACK(w) {