Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/doitsujin/dxvk.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Ashton <joshua@froggi.es>2020-02-20 04:44:45 +0300
committerJoshua Ashton <joshua@froggi.es>2020-02-20 04:44:50 +0300
commitf688889b413d966b0e1894755ebe7678709671fd (patch)
tree3ff259af12e7b0ad33b67ae7ee59a8f3c3afdb26
parent17166a8aeb0adbbd7d58557a4dd854ee91c0e2af (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.cpp5
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(&currentPos) && currentPos == POINT{ X, Y })
+ return;
+
::SetCursorPos(X, Y);
}