瀏覽代碼

Only use a transparent cursor on Windows when connected via RDP

VMware relies on the cursor being set to NULL to optimize relative mouse motion for games.

We should also revisit whether current RDP works better with a NULL cursor or a transparent cursor.

Fixes https://github.com/libsdl-org/SDL/issues/13700

(cherry picked from commit dac6af4ba6815fd88364820c48f55c878575d5bf)
Sam Lantinga 20 小時之前
父節點
當前提交
55b599d693
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4 1
      src/video/windows/SDL_windowsmouse.c

+ 4 - 1
src/video/windows/SDL_windowsmouse.c

@@ -250,7 +250,10 @@ static void WIN_FreeCursor(SDL_Cursor *cursor)
 static int WIN_ShowCursor(SDL_Cursor *cursor)
 {
     if (!cursor) {
-        cursor = SDL_blank_cursor;
+        if (GetSystemMetrics(SM_REMOTESESSION)) {
+            // Use a blank cursor so we continue to get relative motion over RDP
+            cursor = SDL_blank_cursor;
+        }
     }
     if (cursor) {
         SDL_cursor = (HCURSOR)cursor->driverdata;