summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/input/keyboardconfig.cpp4
-rw-r--r--src/utils/sdl2helper.cpp13
2 files changed, 11 insertions, 6 deletions
diff --git a/src/input/keyboardconfig.cpp b/src/input/keyboardconfig.cpp
index c67fb5151..7f2c9fca2 100644
--- a/src/input/keyboardconfig.cpp
+++ b/src/input/keyboardconfig.cpp
@@ -83,8 +83,8 @@ std::string KeyboardConfig::getKeyName(const int key)
if (key > -1)
{
#ifdef USE_SDL2
- return SDL_GetKeyName(SDL_GetKeyFromScancode(
- static_cast<SDL_Scancode>(key)));
+ return SDL_GetScancodeName(
+ static_cast<SDL_Scancode>(key));
#else // USE_SDL2
return SDL_GetKeyName(static_cast<SDLKey>(key));
diff --git a/src/utils/sdl2helper.cpp b/src/utils/sdl2helper.cpp
index 68fb9cf4d..76b4b7fea 100644
--- a/src/utils/sdl2helper.cpp
+++ b/src/utils/sdl2helper.cpp
@@ -219,14 +219,18 @@ void SDL::allowScreenSaver(const bool allow)
if (allow)
{
#if SDL_VERSION_ATLEAST(2, 0, 2)
- SDL_SetHint(SDL_HINT_VIDEO_ALLOW_SCREENSAVER, "1");
+ SDL_SetHintWithPriority(SDL_HINT_VIDEO_ALLOW_SCREENSAVER,
+ "1",
+ SDL_HINT_NORMAL);
#endif // SDL_VERSION_ATLEAST(2, 0, 2)
SDL_EnableScreenSaver();
}
else
{
#if SDL_VERSION_ATLEAST(2, 0, 2)
- SDL_SetHint(SDL_HINT_VIDEO_ALLOW_SCREENSAVER, "0");
+ SDL_SetHintWithPriority(SDL_HINT_VIDEO_ALLOW_SCREENSAVER,
+ "0",
+ SDL_HINT_NORMAL);
#endif // SDL_VERSION_ATLEAST(2, 0, 2)
SDL_DisableScreenSaver();
}
@@ -263,8 +267,9 @@ void SDL::setRendererHint(const std::string &driver)
{
if (!driver.empty())
{
- SDL_SetHint(SDL_HINT_RENDER_DRIVER,
- driver.c_str());
+ SDL_SetHintWithPriority(SDL_HINT_RENDER_DRIVER,
+ driver.c_str(),
+ SDL_HINT_NORMAL);
}
}