commit 14013d2165f62675cf9de255ff734b509ff03325
parent 992427b9edf98c2d0f8b92493e8456193668b74a
Author: Olav Sørensen <olav.sorensen@live.no>
Date: Tue, 6 Jul 2021 16:51:48 +0200
Mouse fix for Wayland (issue #21)
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/ft2_video.c b/src/ft2_video.c
@@ -1006,10 +1006,10 @@ bool setupRenderer(void)
else
SDL_ShowCursor(SDL_FALSE);
- // Workaround: SDL_GetGlobalMouseState() doesn't work with KMSDRM
+ // Workaround: SDL_GetGlobalMouseState() doesn't work with KMSDRM/Wayland
video.useDesktopMouseCoords = true;
const char *videoDriver = SDL_GetCurrentVideoDriver();
- if (videoDriver != NULL && strcmp("KMSDRM", videoDriver) == 0)
+ if (videoDriver != NULL && (strcmp("KMSDRM", videoDriver) == 0 || strcmp("wayland", videoDriver) == 0))
video.useDesktopMouseCoords = false;
SDL_SetRenderDrawColor(video.renderer, 0, 0, 0, SDL_ALPHA_OPAQUE);