diff --git a/CMakeLists.txt b/CMakeLists.txt index a75d42a502..c1ede41273 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -392,7 +392,7 @@ if(${PLAYER_TARGET_PLATFORM} STREQUAL "SDL2") src/sdl2_ui.h) target_compile_definitions(${PROJECT_NAME} PUBLIC USE_SDL=2) - find_package(SDL2 REQUIRED) + find_package(SDL2 2.0.5 REQUIRED) target_link_libraries(${PROJECT_NAME} SDL2::SDL2main) elseif(${PLAYER_TARGET_PLATFORM} STREQUAL "libretro") target_sources(${PROJECT_NAME} PRIVATE diff --git a/configure.ac b/configure.ac index 44cc0aabe8..485fdaace7 100644 --- a/configure.ac +++ b/configure.ac @@ -44,7 +44,7 @@ AS_IF([test "x$with_freetype" != "xno"], [ PKG_CHECK_MODULES([HARFBUZZ],[harfbuzz],[AC_DEFINE(HAVE_HARFBUZZ,[1],[Enable HarfBuzz text shaping])],[auto_harfbuzz=0]) ]) ]) -PKG_CHECK_MODULES([SDL],[sdl2],[AC_DEFINE(USE_SDL,[2],[Enable SDL2])],[ +PKG_CHECK_MODULES([SDL],[sdl2 >= 2.0.5],[AC_DEFINE(USE_SDL,[2],[Enable SDL2])],[ PKG_CHECK_MODULES([SDL],[sdl],[AC_DEFINE(USE_SDL,[1],[Enable SDL])]) ]) AC_ARG_WITH([audio],[AS_HELP_STRING([--without-audio], [Disable audio support. @<:@default=on@:>@])]) diff --git a/src/sdl2_ui.cpp b/src/sdl2_ui.cpp index b9853e5871..604853aedd 100644 --- a/src/sdl2_ui.cpp +++ b/src/sdl2_ui.cpp @@ -453,12 +453,8 @@ void Sdl2Ui::ToggleZoom() { // get maximum usable window size int display_index = SDL_GetWindowDisplayIndex(sdl_window); SDL_Rect max_mode; -#if SDL_VERSION_ATLEAST(2, 0, 5) // this takes account of the menu bar and dock on macOS and task bar on windows SDL_GetDisplayUsableBounds(display_index, &max_mode); -#else - SDL_GetDisplayBounds(display_index, &max_mode); -#endif // reset zoom, if it does not fit if ((max_mode.h < SCREEN_TARGET_HEIGHT * current_display_mode.zoom) || (max_mode.w < SCREEN_TARGET_WIDTH * current_display_mode.zoom)) { @@ -656,12 +652,9 @@ void Sdl2Ui::ProcessMouseWheelEvent(SDL_Event& evnt) { int amount = evnt.wheel.y; - // FIXME: Debian ships older SDL2 -#if SDL_VERSION_ATLEAST(2, 0, 4) // translate direction if (evnt.wheel.direction == SDL_MOUSEWHEEL_FLIPPED) amount *= -1; -#endif keys[Input::Keys::MOUSE_SCROLLUP] = amount > 0; keys[Input::Keys::MOUSE_SCROLLDOWN] = amount < 0;