Commit 86b81abea68e74581a4141edefa3ef5bb3605de5

Manuel Alfayate Corchete 2020-12-28T16:19:19

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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
diff --git a/src/video/kmsdrm_legacy/SDL_kmsdrm_legacy_video.c b/src/video/kmsdrm_legacy/SDL_kmsdrm_legacy_video.c
index acddfc2..9c497cd 100644
--- a/src/video/kmsdrm_legacy/SDL_kmsdrm_legacy_video.c
+++ b/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--;