Monitor (Linux): fix detection with Nvidia drivers

NVIDIA DRM driver reports `enabled` to be `disabled`
This commit is contained in:
李通洲
2024-01-06 19:12:36 +08:00
parent 0af40ab6a3
commit 2ba878cbab
2 changed files with 5 additions and 4 deletions
+1
View File
@@ -14,6 +14,7 @@ Bugfixes:
* Fix support of macOS Sonoma (Wallpaper, macOS)
* Fix overall memory leaks (macOS)
* Remove trailing `\0` in JSON results (FreeBSD)
* Fix physical monitor detection with Nvidia drivers (Monitor, Linux)
# 2.5.0
+4 -4
View File
@@ -29,10 +29,10 @@ const char* ffDetectMonitor(FFlist* results)
ffStrbufAppendS(&drmDir, entry->d_name);
uint32_t drmDirWithDnameLength = drmDir.length;
ffStrbufAppendS(&drmDir, "/enabled");
char enabled = 'd'; // disabled
ffReadFileData(drmDir.chars, sizeof(enabled), &enabled);
if (enabled != 'e') // enabled
ffStrbufAppendS(&drmDir, "/status");
char status = 'd'; // disconnected
ffReadFileData(drmDir.chars, sizeof(status), &status);
if (status != 'c') // connected
{
ffStrbufSubstrBefore(&drmDir, drmDirLength);
continue;