]> source.dussan.org Git - tigervnc.git/commitdiff
Track outputs instead of CRTCs, as those better match the screen concept
authorPierre Ossman <ossman@cendio.se>
Thu, 12 Jul 2012 12:40:50 +0000 (12:40 +0000)
committerPierre Ossman <ossman@cendio.se>
Thu, 12 Jul 2012 12:40:50 +0000 (12:40 +0000)
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
unix/xserver/hw/vnc/XserverDesktop.h

index 6b1c2d9d604cf2fb9b9dcc7f2d5fc315d094ecd6..45aa468a423034d5df28f52c8882ea36c5e862fd 100644 (file)
@@ -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;
index 4e9b99b8eecec675156a80de5a0e0ce1e4d3a8ce..da107bc8beec003044e1308932f87a16471fdf40 100644 (file)
@@ -146,8 +146,8 @@ private:
   rfb::CharArray queryConnectUsername;
 
 #ifdef RANDR
-  typedef std::map<RRCrtcPtr, rdr::U32> CrtcIdMap;
-  CrtcIdMap crtcIdMap;
+  typedef std::map<RROutputPtr, rdr::U32> OutputIdMap;
+  OutputIdMap outputIdMap;
 #endif
 };
 #endif