Commit 244d0ad85483787af96cc1b862649a0735693554

Manuel Alfayate Corchete 2020-09-08T15:30:45

kmsdrm: Tell SDL that mouse has entered the window via artificial event. Fixes sticky mouse in Scummvm.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
diff --git a/src/video/kmsdrm/SDL_kmsdrmvideo.c b/src/video/kmsdrm/SDL_kmsdrmvideo.c
index 54162b6..fba1d14 100644
--- a/src/video/kmsdrm/SDL_kmsdrmvideo.c
+++ b/src/video/kmsdrm/SDL_kmsdrmvideo.c
@@ -1643,6 +1643,15 @@ KMSDRM_CreateWindow(_THIS, SDL_Window * window)
     SDL_SetMouseFocus(window);
     SDL_SetKeyboardFocus(window);
 
+    /***********************************************************/
+    /* Tell SDL that the mouse has entered the window using an */
+    /* artificial event: we have no windowing system to tell   */
+    /* SDL that it has happened. This makes SDL set the        */
+    /* SDL_WINDOW_MOUSE_FOCUS on this window, thus fixing      */
+    /* Scummvm sticky-on-sides software cursor.                */
+    /***********************************************************/
+    SDL_SendWindowEvent(window, SDL_WINDOWEVENT_ENTER, 0, 0);
+
     return 0;
 
 error: