mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-06-06 15:30:50 +00:00
Add utility function to detect if SDL is inside a sandbox
Refactor the previous sandbox check in a standalone function that also includes Snap support. Signed-off-by: Ludovico de Nittis <ludovico.denittis@collabora.com>
This commit is contained in:
parent
a3ce700ded
commit
e8cb4da71f
8 changed files with 100 additions and 16 deletions
|
@ -77,6 +77,7 @@
|
|||
|
||||
#include "../../core/linux/SDL_evdev_capabilities.h"
|
||||
#include "../../core/linux/SDL_udev.h"
|
||||
#include "../../core/linux/SDL_sandbox.h"
|
||||
|
||||
#if 0
|
||||
#define DEBUG_INPUT_EVENTS 1
|
||||
|
@ -756,12 +757,7 @@ LINUX_JoystickInit(void)
|
|||
SDL_LogDebug(SDL_LOG_CATEGORY_INPUT,
|
||||
"udev disabled by SDL_JOYSTICK_DISABLE_UDEV");
|
||||
enumeration_method = ENUMERATION_FALLBACK;
|
||||
|
||||
} else if (access("/.flatpak-info", F_OK) == 0
|
||||
|| access("/run/host/container-manager", F_OK) == 0) {
|
||||
/* Explicitly check `/.flatpak-info` because, for old versions of
|
||||
* Flatpak, this was the only available way to tell if we were in
|
||||
* a Flatpak container. */
|
||||
} else if (SDL_DetectSandbox() != SDL_SANDBOX_NONE) {
|
||||
SDL_LogDebug(SDL_LOG_CATEGORY_INPUT,
|
||||
"Container detected, disabling udev integration");
|
||||
enumeration_method = ENUMERATION_FALLBACK;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue