From a99fe098ac527ac31fed56cddf720f6184aa85bf Mon Sep 17 00:00:00 2001 From: pelya Date: Sun, 29 Mar 2015 22:54:44 +0300 Subject: [PATCH] Fixed mouse input not processed, fixed PC compilation --- src/tutorial_gui.cpp | 8 ++++++++ src/video/sdl_v.cpp | 7 ++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/tutorial_gui.cpp b/src/tutorial_gui.cpp index 26d3dfb1e0..bbaadba7fb 100644 --- a/src/tutorial_gui.cpp +++ b/src/tutorial_gui.cpp @@ -14,7 +14,9 @@ #include "stdafx.h" +#ifdef __ANDROID__ #include +#endif #include "tutorial_gui.h" #include "debug.h" @@ -63,7 +65,13 @@ void OpenExternTutorialVideo(VideoLink_t *tutorial) if (!link) { return; } +#ifdef __ANDROID__ SDL_ANDROID_OpenExternalWebBrowser(link); +#else + char cmd[PATH_MAX] = "xdg-open "; + strcat(cmd, link); + system(cmd); +#endif } static const NWidgetPart _nested_tutorial_widgets[] = { diff --git a/src/video/sdl_v.cpp b/src/video/sdl_v.cpp index b649d8c294..2b5b4ca0d1 100644 --- a/src/video/sdl_v.cpp +++ b/src/video/sdl_v.cpp @@ -563,13 +563,10 @@ int VideoDriver_SDL::PollEvent() switch (ev.type) { case SDL_MOUSEMOTION: -#ifdef __ANDROID__ - // No mouse warping on Android, mouse strictly follows finger - if (false) { -#else if (_cursor.UpdateCursorPosition(ev.motion.x, ev.motion.y, true)) { -#endif +#ifndef __ANDROID__ // No mouse warping on Android, mouse strictly follows finger SDL_CALL SDL_WarpMouse(_cursor.pos.x, _cursor.pos.y); +#endif } HandleMouseEvents(); break;