From 1d3be39bcd8ed3b061f2d354454fb7ed0f174b40 Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Thu, 12 Jul 2012 12:40:50 +0000 Subject: [PATCH] Track outputs instead of CRTCs, as those better match the screen concept in RFB. git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4932 3789f03b-4d11-0410-bbf8-ca57d06f2519 --- unix/xserver/hw/vnc/XserverDesktop.cc | 28 ++++++++++++++------------- unix/xserver/hw/vnc/XserverDesktop.h | 4 ++-- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/unix/xserver/hw/vnc/XserverDesktop.cc b/unix/xserver/hw/vnc/XserverDesktop.cc index 6b1c2d9d..45aa468a 100644 --- a/unix/xserver/hw/vnc/XserverDesktop.cc +++ b/unix/xserver/hw/vnc/XserverDesktop.cc @@ -237,45 +237,47 @@ ScreenSet XserverDesktop::computeScreenLayout() layout.add_screen(Screen(0, 0, 0, pScreen->width, pScreen->height, 0)); #else rrScrPrivPtr rp = rrGetScrPriv(pScreen); - CrtcIdMap newIdMap; + OutputIdMap newIdMap; - for (int i = 0;i < rp->numCrtcs;i++) { + for (int i = 0;i < rp->numOutputs;i++) { + RROutputPtr output; RRCrtcPtr crtc; - crtc = rp->crtcs[i]; + output = rp->outputs[i]; + crtc = output->crtc; /* Disabled? */ - if (crtc->mode == NULL) + if ((crtc == NULL) || (crtc->mode == NULL)) continue; - /* Known CRTC? */ - if (crtcIdMap.count(crtc) == 1) - newIdMap[crtc] = crtcIdMap[crtc]; + /* Known output? */ + if (outputIdMap.count(output) == 1) + newIdMap[output] = outputIdMap[output]; else { rdr::U32 id; - CrtcIdMap::const_iterator iter; + OutputIdMap::const_iterator iter; while (true) { id = rand(); - for (iter = crtcIdMap.begin();iter != crtcIdMap.end();++iter) { + for (iter = outputIdMap.begin();iter != outputIdMap.end();++iter) { if (iter->second == id) break; } - if (iter == crtcIdMap.end()) + if (iter == outputIdMap.end()) break; } - newIdMap[crtc] = id; + newIdMap[output] = id; } - layout.add_screen(Screen(newIdMap[crtc], crtc->x, crtc->y, + layout.add_screen(Screen(newIdMap[output], crtc->x, crtc->y, crtc->mode->mode.width, crtc->mode->mode.height, 0)); } /* Only keep the entries that are currently active */ - crtcIdMap = newIdMap; + outputIdMap = newIdMap; #endif return layout; diff --git a/unix/xserver/hw/vnc/XserverDesktop.h b/unix/xserver/hw/vnc/XserverDesktop.h index 4e9b99b8..da107bc8 100644 --- a/unix/xserver/hw/vnc/XserverDesktop.h +++ b/unix/xserver/hw/vnc/XserverDesktop.h @@ -146,8 +146,8 @@ private: rfb::CharArray queryConnectUsername; #ifdef RANDR - typedef std::map CrtcIdMap; - CrtcIdMap crtcIdMap; + typedef std::map OutputIdMap; + OutputIdMap outputIdMap; #endif }; #endif -- 2.39.5