Game detection: ignore steam fossilize processes

This commit is contained in:
dec05eba
2026-04-18 07:58:44 +02:00
parent 1b87bf88d7
commit 17e5d17415
3 changed files with 6 additions and 3 deletions

View File

@@ -1,4 +1,4 @@
project('gsr-ui', ['c', 'cpp'], version : '1.11.0', default_options : ['warning_level=2', 'cpp_std=c++17'], subproject_dir : 'depends')
project('gsr-ui', ['c', 'cpp'], version : '1.11.1', default_options : ['warning_level=2', 'cpp_std=c++17'], subproject_dir : 'depends')
add_project_arguments('-D_FILE_OFFSET_BITS=64', language : ['c', 'cpp'])

View File

@@ -1,7 +1,7 @@
[package]
name = "gsr-ui"
type = "executable"
version = "1.11.0"
version = "1.11.1"
platforms = ["posix"]
[lang.cpp]

View File

@@ -1,5 +1,6 @@
#include <stdio.h>
#include <string.h>
#include <stdbool.h>
#include <unistd.h>
#include <errno.h>
#include <fcntl.h>
@@ -106,11 +107,13 @@ static void check_process(pid_t pid) {
char path[64];
ssize_t env_n, cmd_n;
bool is_steam_fossilize = false;
snprintf(path, sizeof(path), "/proc/%d/environ", pid);
env_n = read_file(path, environ_buf, sizeof(environ_buf));
if (env_n > 0) {
is_steam_fossilize = env_get(environ_buf, env_n, "STEAM_FOSSILIZE_DUMP_PATH_READ_ONLY");
const char *appid = env_get(environ_buf, env_n, "SteamAppId");
if (!appid) appid = env_get(environ_buf, env_n, "SteamGameId");
if (appid && appid[0] >= '1' && appid[0] <= '9') {
@@ -122,7 +125,7 @@ static void check_process(pid_t pid) {
snprintf(path, sizeof(path), "/proc/%d/cmdline", pid);
cmd_n = read_file(path, cmdline_buf, sizeof(cmdline_buf));
if (cmd_n > 0 && (is_wine_binary(cmdline_buf) || has_game_arch_suffix(cmdline_buf)) && !memmem(cmdline_buf, cmd_n, "d3ddriverquery", 14))
if (cmd_n > 0 && (is_wine_binary(cmdline_buf) || has_game_arch_suffix(cmdline_buf)) && !is_steam_fossilize)
add_game(pid);
}