From 2fea095fc7202a6707c6f5499565f125927ae544 Mon Sep 17 00:00:00 2001 From: Tarek Soliman Date: Thu, 19 Oct 2017 00:55:58 -0500 Subject: SDL: Fix SDL1 cursor position when using a touchscreen I noticed that in Maemo the cursor was offset after the SDL refactoring in de2bbe3b9738ef95b2529db989570770ef434f9d In Maemo when entering fullscreen, ScummVM receives a SDL_VIDEORESIZE event with the native touchscreen resolution rather than the current window size. This causes a call to notifyResize. Before that refactoring, notifyResize did nothing (in SDL1). Now it calls handleResize but doesn't actually set a new video mode. This messes up the coordinate mapping, causing an overcorrection for the cursor position. --- backends/graphics/surfacesdl/surfacesdl-graphics.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/backends/graphics/surfacesdl/surfacesdl-graphics.cpp b/backends/graphics/surfacesdl/surfacesdl-graphics.cpp index b616914e53..262ea84096 100644 --- a/backends/graphics/surfacesdl/surfacesdl-graphics.cpp +++ b/backends/graphics/surfacesdl/surfacesdl-graphics.cpp @@ -2642,7 +2642,9 @@ void SurfaceSdlGraphicsManager::notifyVideoExpose() { } void SurfaceSdlGraphicsManager::notifyResize(const int width, const int height) { +#if SDL_VERSION_ATLEAST(2, 0, 0) handleResize(width, height); +#endif } #if SDL_VERSION_ATLEAST(2, 0, 0) -- cgit v1.2.3