Use map_files instead of lsof for wined3d detection
@@ -78,14 +78,25 @@ void imgui_init()
}
if (sw_stats.engine != EngineTypes::ZINK){
+ sw_stats.engine = OPENGL;
+
+ stringstream ss;
+ string line;
auto pid = getpid();
- string find_wined3d = "lsof -w -lnPX -L -p " + to_string(pid) + " | grep -oh wined3d";
- string ret_wined3d = exec(find_wined3d);
- if (ret_wined3d == "wined3d\n" )
+ string path = "/proc/" + to_string(pid) + "/map_files/";
+ auto files = exec("ls " + path);
+ ss << files;
+
+ while(std::getline(ss, line, '\n')){
+ auto file = path + line;
+ auto sym = read_symlink(file.c_str());
+ if (sym.find("wined3d") != std::string::npos) {
sw_stats.engine = WINED3D;
- else
- sw_stats.engine = OPENGL;
+ break;
}
+ }
+ }
+
is_blacklisted(true);
notifier.params = &params;
start_notifier(notifier);
