Skip to content

Commit

Permalink
Monitor (Linux): don't report disabled monitors
Browse files Browse the repository at this point in the history
  • Loading branch information
CarterLi committed Nov 28, 2023
1 parent 0c522bd commit 968a43c
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/detection/monitor/monitor_linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,18 @@ const char* ffDetectMonitor(FFlist* results)
continue;

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
{
ffStrbufSubstrBefore(&drmDir, drmDirLength);
continue;
}

ffStrbufSubstrBefore(&drmDir, drmDirWithDnameLength);
ffStrbufAppendS(&drmDir, "/edid");

uint8_t edidData[512];
Expand Down

0 comments on commit 968a43c

Please sign in to comment.