ソースを参照

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

Manuel Alfayate Corchete 4 年 前
コミット
244d0ad854
1 ファイル変更9 行追加0 行削除
  1. 9 0
      src/video/kmsdrm/SDL_kmsdrmvideo.c

+ 9 - 0
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: