feat(exe): fix comments, remove regex dependency

This commit is contained in:
Rerence1016 2025-08-03 23:38:56 +08:00 committed by Pancake
parent ec59c072b5
commit 26e4dc5827
3 changed files with 3 additions and 5 deletions

1
ui/Cargo.lock generated
View file

@ -690,7 +690,6 @@ dependencies = [
"libadwaita",
"proc-maps",
"procfs",
"regex",
"serde",
"toml 0.9.2",
]

View file

@ -11,7 +11,6 @@ toml = "0.9.2"
anyhow = "1.0"
procfs = "0.17.0"
proc-maps = "0.4.0"
regex = "1.11.1"
[build-dependencies]
glib-build-tools = "0.21.0"

View file

@ -26,7 +26,7 @@ pub fn find_vulkan_processes() -> ProcResult<Vec<(String, String)>> {
let pid = process.pid();
// By default, assume Linux process, and use comm
// By default, assume Linux process, and use /proc/self/comm
let mut name = process.stat()?.comm;
// Solely just for checking if it's a Proton or Wine process
@ -35,13 +35,13 @@ pub fn find_vulkan_processes() -> ProcResult<Vec<(String, String)>> {
// If this is a Proton or Wine process with .exe,
// then extract just the .exe name with RegEx
// then just get filename from /proc/self/maps
if cmdline.contains(".exe") {
for map in &maps {
if let Some(path) = map.filename() {
let path_str = path.to_string_lossy().to_lowercase();
if path_str.contains(".exe") &&
!path_str.contains("wine") &&
!path_str.contains("wine") && // Make sure .exe is not from Wine
path_str.contains('/') ||
path_str.contains('\\') {