Browse Source

[KMS/DRM_LEGACY] Prevent mouse cursor from staying onscreen after window destruction. Patch by Ozkan Sezer.

Manuel Alfayate Corchete 4 years ago
parent
commit
86b81abea6
1 changed files with 7 additions and 1 deletions
  1. 7 1
      src/video/kmsdrm_legacy/SDL_kmsdrm_legacy_video.c

+ 7 - 1
src/video/kmsdrm_legacy/SDL_kmsdrm_legacy_video.c

@@ -821,9 +821,15 @@ KMSDRM_LEGACY_DestroyWindow(_THIS, SDL_Window * window)
         return;
     }
 
-    /* Remove from the internal window list */
     viddata = windata->viddata;
 
+    /* If this is the only window left, hide the cursor. */
+    if (viddata->num_windows == 1)
+    {
+        SDL_ShowCursor(SDL_FALSE);
+    }
+
+    /* Remove from the internal window list */
     for (i = 0; i < viddata->num_windows; i++) {
         if (viddata->windows[i] == window) {
             viddata->num_windows--;