From 4604ee1caf00fe1a8c095119c1046e7f625e1f0b Mon Sep 17 00:00:00 2001 From: Thorbjørn Lindeijer Date: Mon, 25 Mar 2024 19:45:58 +0000 Subject: Allow mouse focus click-through This is generally expected on Linux, where it feels annoying that the initial click just focuses the window. On macOS it's a little bit different, since applications can be specific about which elements are directly clickable and which aren't, but in general it feels better to me when the UI can be interacted with directly. --- src/CMakeLists.txt | 2 +- src/client.cpp | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 465ba0e8..14547870 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,5 +1,5 @@ include(FindPkgConfig) -pkg_check_modules(SDL2 REQUIRED sdl2>=2.0.1 SDL2_image SDL2_mixer SDL2_net SDL2_ttf) +pkg_check_modules(SDL2 REQUIRED sdl2>=2.0.5 SDL2_image SDL2_mixer SDL2_net SDL2_ttf) FIND_PACKAGE(PhysFS REQUIRED) FIND_PACKAGE(CURL REQUIRED) FIND_PACKAGE(LibXml2 REQUIRED) diff --git a/src/client.cpp b/src/client.cpp index eac55c83..7d887436 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -248,6 +248,8 @@ Client::Client(const Options &options): } atexit(SDL_Quit); + SDL_SetHint(SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH, "1"); + ResourceManager *resman = ResourceManager::getInstance(); if (!resman->setWriteDir(mLocalDataDir)) -- cgit v1.2.3-70-g09d2