diff options
| author | Thomas Jarosch <tomj@simonv.com> | 2011-05-25 20:11:03 +0000 |
|---|---|---|
| committer | Thomas Jarosch <tomj@simonv.com> | 2011-05-25 20:11:03 +0000 |
| commit | eec4e9ff6a19a04d0ceff448dd4b16b1f6f6508c (patch) | |
| tree | 7b068417456e2a0c606bc21327a6b820512a80da | |
| parent | cc9079d24d6dd73f2118a1b413fbaa3f13ed44a1 (diff) | |
| download | rockbox-eec4e9ff6a19a04d0ceff448dd4b16b1f6f6508c.zip rockbox-eec4e9ff6a19a04d0ceff448dd4b16b1f6f6508c.tar.gz rockbox-eec4e9ff6a19a04d0ceff448dd4b16b1f6f6508c.tar.bz2 rockbox-eec4e9ff6a19a04d0ceff448dd4b16b1f6f6508c.tar.xz | |
Fix SDL touch screen handling on the screen edges
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29925 a1c6a512-1295-4272-9138-f99709370657
| -rw-r--r-- | firmware/target/hosted/sdl/system-sdl.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/firmware/target/hosted/sdl/system-sdl.c b/firmware/target/hosted/sdl/system-sdl.c index 750a014..93a8a7c 100644 --- a/firmware/target/hosted/sdl/system-sdl.c +++ b/firmware/target/hosted/sdl/system-sdl.c @@ -138,8 +138,15 @@ static int sdl_event_thread(void * param) } #if (CONFIG_PLATFORM & (PLATFORM_MAEMO|PLATFORM_PANDORA)) - /* Hide mouse cursor on real touchscreen device */ - SDL_ShowCursor(SDL_DISABLE); + /* 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. + */ + uint8_t hiddenCursorData = 0; + SDL_Cursor *hiddenCursor = SDL_CreateCursor(&hiddenCursorData, &hiddenCursorData, 8, 1, 0, 0); + + SDL_ShowCursor(SDL_ENABLE); + SDL_SetCursor(hiddenCursor); #endif SDL_WM_SetCaption(UI_TITLE, NULL); @@ -174,6 +181,10 @@ static int sdl_event_thread(void * param) SDL_WaitThread(maemo_thread, NULL); #endif +#if (CONFIG_PLATFORM & (PLATFORM_MAEMO|PLATFORM_PANDORA)) + SDL_FreeCursor(hiddenCursor); +#endif + if(picture_surface) SDL_FreeSurface(picture_surface); |