From 6265bbbd97e5f178020ae9d28bd0f00aa4809ae4 Mon Sep 17 00:00:00 2001 From: Solomon Peachy Date: Wed, 6 Aug 2025 21:26:41 -0400 Subject: [PATCH] sdl: Explicitly disable the cursor for non-touchscreen devices ...Except for simulators, those always need the cursor In practice this only affects the RG Nano as it is currently our only SDL target that lacks a touchscreen. Change-Id: I292f923848528c233da518b062d9ccd8a03515dd --- firmware/target/hosted/sdl/system-sdl.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/firmware/target/hosted/sdl/system-sdl.c b/firmware/target/hosted/sdl/system-sdl.c index 15eab0f978..365f06f1ff 100644 --- a/firmware/target/hosted/sdl/system-sdl.c +++ b/firmware/target/hosted/sdl/system-sdl.c @@ -99,11 +99,8 @@ static int sdl_event_thread(void * param) sdl_window_setup(); #endif -#if (CONFIG_PLATFORM & PLATFORM_MAEMO) - SDL_sem *wait_for_maemo_startup; -#endif - -#if (CONFIG_PLATFORM & (PLATFORM_MAEMO|PLATFORM_PANDORA)) || defined(RG_NANO) +#if !defined(SIMULATOR) +#if defined(HAVE_TOUCHSCREEN) /* SDL touch screen fix: Work around a SDL assumption that returns relative mouse coordinates when you get to the screen edges using the touchscreen and a disabled mouse cursor. @@ -113,11 +110,15 @@ static int sdl_event_thread(void * param) SDL_ShowCursor(SDL_ENABLE); SDL_SetCursor(hiddenCursor); -#endif +#else /* !HAVE_TOUCHSCREEN */ + /* Explicitly disable the cursor on non-touch targets */ + SDL_ShowCursor(SDL_DISABLE); +#endif /* !HAVE_TOUCHSCREEN */ +#endif /* !SIMULATOR */ #if (CONFIG_PLATFORM & PLATFORM_MAEMO) /* start maemo thread: Listen to display on/off events and battery monitoring */ - wait_for_maemo_startup = SDL_CreateSemaphore(0); /* 0-count so it blocks */ + SDL_sem *wait_for_maemo_startup = SDL_CreateSemaphore(0); /* 0-count so it blocks */ SDL_Thread *maemo_thread = SDL_CreateThread(maemo_thread_func, NULL, wait_for_maemo_startup); SDL_SemWait(wait_for_maemo_startup); SDL_DestroySemaphore(wait_for_maemo_startup);