summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2015-02-28 17:13:07 +0000
committerfrosch <frosch@openttd.org>2015-02-28 17:13:07 +0000
commit70e575e7d7e5762c65c03fd0ac80deed846fd4c2 (patch)
tree0373c0641ac896588e06eeb1fdfeedaadc68fc01
parent4990263940da24e0ce49967b703e29370586ccf4 (diff)
downloadopenttd-70e575e7d7e5762c65c03fd0ac80deed846fd4c2.tar.xz
(svn r27172) -Fix [FS#6238] (r27167): Apparently Windows randomly drops SetCursorPos calls. According to internet due to incorrect/missing synchronisation in threads accessing the event queue.
-rw-r--r--src/gfx.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/gfx.cpp b/src/gfx.cpp
index 64c7d9186..410a2ee96 100644
--- a/src/gfx.cpp
+++ b/src/gfx.cpp
@@ -1636,8 +1636,11 @@ bool CursorVars::UpdateCursorPosition(int x, int y, bool queued_warp)
bool need_warp = false;
if (this->fix_at) {
- if (!this->queued_warp && (this->delta.x != 0 || this->delta.y != 0)) {
- /* Trigger warp. */
+ if (this->delta.x != 0 || this->delta.y != 0) {
+ /* Trigger warp.
+ * Note: We also trigger warping again, if there is already a pending warp.
+ * This makes it more tolerant about the OS or other software inbetween
+ * botchering the warp. */
this->queued_warp = queued_warp;
need_warp = true;
}