From 8fcf6cc65971ffe5384384c8fede568877e3a032 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Peter=20=C3=85strand=20=28astrand=29?= Date: Tue, 20 Mar 2018 10:26:40 +0100 Subject: [PATCH] Avoid disabling outputs which are already disabled Better to avoid making unnecessary calls, but mainly we want to avoid logging false errors. --- unix/common/randr.cxx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/unix/common/randr.cxx b/unix/common/randr.cxx index 76ae0bc3..9cfc95dd 100644 --- a/unix/common/randr.cxx +++ b/unix/common/randr.cxx @@ -300,6 +300,10 @@ unsigned int setScreenLayout(int fb_width, int fb_height, const rfb::ScreenSet& if (outputIdMap->count(output) == 1) continue; + /* Enabled? */ + if (!vncRandRIsOutputEnabled(i)) + continue; + /* Disable and move on... */ ret = vncRandRDisableOutput(i); if (!ret) { -- 2.39.5