From 86b81abea68e74581a4141edefa3ef5bb3605de5 Mon Sep 17 00:00:00 2001 From: Manuel Alfayate Corchete Date: Mon, 28 Dec 2020 16:19:19 +0100 Subject: [PATCH] [KMS/DRM_LEGACY] Prevent mouse cursor from staying onscreen after window destruction. Patch by Ozkan Sezer. --- src/video/kmsdrm_legacy/SDL_kmsdrm_legacy_video.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/video/kmsdrm_legacy/SDL_kmsdrm_legacy_video.c b/src/video/kmsdrm_legacy/SDL_kmsdrm_legacy_video.c index acddfc29a..9c497cd64 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--;