From 48286a0a06f2600cbe24e7544c00e51c174ecb01 Mon Sep 17 00:00:00 2001 From: Bryan Roe Date: Thu, 23 Apr 2020 22:42:45 -0700 Subject: [PATCH] Agent has new KVM detection logic, which retries every 10 seconds for 3 minutes if XLIBS are detected, but X server is not. Meshcore now hooks the event, so if detection is found, the server is updated. --- agents/meshcore.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/agents/meshcore.js b/agents/meshcore.js index 833e874b..54036a75 100644 --- a/agents/meshcore.js +++ b/agents/meshcore.js @@ -326,7 +326,21 @@ function createMeshCore(agent) { childProcess = require('child_process'); if (mesh.hasKVM == 1) { // if the agent is compiled with KVM support // Check if this computer supports a desktop - try { if ((process.platform == 'win32') || (process.platform == 'darwin') || (require('monitor-info').kvm_x11_support)) { meshCoreObj.caps |= 1; } } catch (ex) { } + try + { + if ((process.platform == 'win32') || (process.platform == 'darwin') || (require('monitor-info').kvm_x11_support)) + { + meshCoreObj.caps |= 1; + } + else if(process.platform == 'linux' || process.platform == 'freebsd') + { + require('monitor-info').on('kvmSupportDetected', function (value) + { + meshCoreObj.caps |= 1; + mesh.SendCommand(meshCoreObj); + }); + } + } catch (ex) { } } } else { // Running in nodejs