mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-13 18:17:39 -04:00
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
This commit is contained in:
parent
209f833c7a
commit
6265bbbd97
1 changed files with 8 additions and 7 deletions
|
@ -99,11 +99,8 @@ static int sdl_event_thread(void * param)
|
||||||
sdl_window_setup();
|
sdl_window_setup();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (CONFIG_PLATFORM & PLATFORM_MAEMO)
|
#if !defined(SIMULATOR)
|
||||||
SDL_sem *wait_for_maemo_startup;
|
#if defined(HAVE_TOUCHSCREEN)
|
||||||
#endif
|
|
||||||
|
|
||||||
#if (CONFIG_PLATFORM & (PLATFORM_MAEMO|PLATFORM_PANDORA)) || defined(RG_NANO)
|
|
||||||
/* SDL touch screen fix: Work around a SDL assumption that returns
|
/* SDL touch screen fix: Work around a SDL assumption that returns
|
||||||
relative mouse coordinates when you get to the screen edges
|
relative mouse coordinates when you get to the screen edges
|
||||||
using the touchscreen and a disabled mouse cursor.
|
using the touchscreen and a disabled mouse cursor.
|
||||||
|
@ -113,11 +110,15 @@ static int sdl_event_thread(void * param)
|
||||||
|
|
||||||
SDL_ShowCursor(SDL_ENABLE);
|
SDL_ShowCursor(SDL_ENABLE);
|
||||||
SDL_SetCursor(hiddenCursor);
|
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)
|
#if (CONFIG_PLATFORM & PLATFORM_MAEMO)
|
||||||
/* start maemo thread: Listen to display on/off events and battery monitoring */
|
/* 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_Thread *maemo_thread = SDL_CreateThread(maemo_thread_func, NULL, wait_for_maemo_startup);
|
||||||
SDL_SemWait(wait_for_maemo_startup);
|
SDL_SemWait(wait_for_maemo_startup);
|
||||||
SDL_DestroySemaphore(wait_for_maemo_startup);
|
SDL_DestroySemaphore(wait_for_maemo_startup);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue