# HG changeset patch # User cheesesucker@33b003aa-7bff-0310-803a-e67f0ece8222 # Date 1244509745 0 # Node ID 4fa875d06e28c57a4fed9152dc86f7abd97e998e # Parent a0068e00f076455a7e281fb026bf77068257ca58 A workaround for a bug in SDL which makes the cursor jump when SDL_ShowCursor() is called. This patch does not completely fix the problem, but at least makes the editor usable in fullscreen mode. diff -r a0068e00f076 -r 4fa875d06e28 engine/core/video/cursor.cpp --- a/engine/core/video/cursor.cpp Mon Jun 08 21:04:43 2009 +0000 +++ b/engine/core/video/cursor.cpp Tue Jun 09 01:09:05 2009 +0000 @@ -95,11 +95,20 @@ void Cursor::set(MouseCursorType ctype, unsigned int cursor_id) { m_cursor_id = cursor_id; m_cursor_type = ctype; + int mx, my; + SDL_GetMouseState(&mx, &my); + if (ctype == CURSOR_NATIVE) { - SDL_ShowCursor(1); + if (!SDL_ShowCursor(1)) { + SDL_PumpEvents(); + SDL_WarpMouse(mx, my); + } setNativeCursor(cursor_id); } else { - SDL_ShowCursor(0); + if (SDL_ShowCursor(0)) { + SDL_PumpEvents(); + SDL_WarpMouse(mx, my); + } if (ctype == CURSOR_ANIMATION) { m_animtime = m_timemanager->getTime(); }