1
0
mirror of https://github.com/EduApps-CDG/OpenDX synced 2024-12-30 09:45:37 +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 
This commit is contained in:
Joshua Ashton 2020-02-20 01:44:45 +00:00
parent 17166a8aeb
commit f688889b41

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