graphics() fallback display detection (windows)

This commit is contained in:
Sebastian Hildebrandt
2019-10-18 16:57:18 +02:00
parent 85fa8fb074
commit 0ccc0abc38
4 changed files with 25 additions and 1 deletions
+18
View File
@@ -687,6 +687,8 @@ function graphics(callback) {
vendor = util.getValue(linesDisplay, 'MonitorManufacturer', '=');
model = util.getValue(linesDisplay, 'Name', '=');
deviceID = util.getValue(linesDisplay, 'PNPDeviceID', '=').replace(/&/g, '&').toLowerCase();
resolutionx = parseInt((util.getValue(linesDisplay, 'ScreenWidth', '=') || '0'), 10);
resolutionx = parseInt((util.getValue(linesDisplay, 'ScreenHeight', '=') || '0'), 10);
}
for (let i = 0; i < ssections.length; i++) {
@@ -722,6 +724,22 @@ function graphics(callback) {
});
}
}
if (ssections.length === 0) {
displays.push({
vendor,
model,
main: true,
resolutionx,
resolutiony,
sizex: -1,
sizey: -1,
pixeldepth: -1,
currentResX: resolutionx,
currentResY: resolutiony,
positionX: 0,
positionY: 0
});
}
return displays;
}