shithub: ft²

Download patch

ref: 14013d2165f62675cf9de255ff734b509ff03325
parent: 992427b9edf98c2d0f8b92493e8456193668b74a
author: Olav Sørensen <olav.sorensen@live.no>
date: Tue Jul 6 12:52:15 EDT 2021

Mouse fix for Wayland (issue #21)

--- a/src/ft2_video.c
+++ b/src/ft2_video.c
@@ -1006,10 +1006,10 @@
 	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);