diff options
author | Joshua Ashton <joshua@froggi.es> | 2020-02-20 04:44:45 +0300 |
---|---|---|
committer | Joshua Ashton <joshua@froggi.es> | 2020-02-20 04:44:50 +0300 |
commit | f688889b413d966b0e1894755ebe7678709671fd (patch) | |
tree | 3ff259af12e7b0ad33b67ae7ee59a8f3c3afdb26 | |
parent | 17166a8aeb0adbbd7d58557a4dd854ee91c0e2af (diff) |
[d3d9] Avoid setting cursor position if we are already at that positiond3d9-cursor-pos
Avoids an infinite loop where we trigger the cursor move window message which calls SetCursorPos and so on and so forth...
Closes #1400
-rw-r--r-- | src/d3d9/d3d9_cursor.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/d3d9/d3d9_cursor.cpp b/src/d3d9/d3d9_cursor.cpp index ad3903d0..408268c1 100644 --- a/src/d3d9/d3d9_cursor.cpp +++ b/src/d3d9/d3d9_cursor.cpp @@ -1,10 +1,15 @@ #include "d3d9_cursor.h" +#include "d3d9_util.h" #include <utility> namespace dxvk { void D3D9Cursor::UpdateCursor(int X, int Y) { + POINT currentPos = { }; + if (::GetCursorPos(¤tPos) && currentPos == POINT{ X, Y }) + return; + ::SetCursorPos(X, Y); } |