Skip to content

Commit

Permalink
kmsdrm: Tell SDL that mouse has entered the window via artificial eve…
Browse files Browse the repository at this point in the history
…nt. Fixes sticky mouse in Scummvm.
  • Loading branch information
vanfanel committed Sep 8, 2020
1 parent 550e153 commit 244d0ad
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/video/kmsdrm/SDL_kmsdrmvideo.c
Expand Up @@ -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:
Expand Down

0 comments on commit 244d0ad

Please sign in to comment.