1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-02-20 19:54:19 +01:00

[d3d9] Avoid setting cursor position if we are already at that position

Avoids an infinite loop where we trigger the cursor move window message which calls SetCursorPos and so on and so forth...

Closes #1400
This commit is contained in:
Joshua Ashton 2020-02-20 01:44:45 +00:00
parent 17166a8aeb
commit f688889b41

View File

@ -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);
}