- Timestamp:
- Jan 8, 2020 4:20:38 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/x11/VBoxClient/display-svga.cpp
r82668 r82674 96 96 }; 97 97 98 struct DRMVMWRECT aRects[VMW_MAX_HEADS];99 100 98 static void drmConnect(struct DRMCONTEXT *pContext) 101 99 { … … 186 184 unsigned i; 187 185 int rc; 186 struct DRMVMWRECT aRects[VMW_MAX_HEADS]; 187 unsigned cHeads; 188 188 /* Do not acknowledge the first event we query for to pick up old events, 189 189 * e.g. from before a guest reboot. */ … … 217 217 if (cDisplaysOut > 0) 218 218 { 219 cHeads = 0; 219 220 for (i = 0; i < cDisplaysOut && i < VMW_MAX_HEADS; ++i) 220 221 { 221 222 if (!(aDisplays[i].fDisplayFlags & VMMDEV_DISPLAY_DISABLED)) 222 223 { 223 uint32_t idDisplay = aDisplays[i].idDisplay; 224 if (idDisplay < VMW_MAX_HEADS) 224 if ((i == 0) || (aDisplays[i].fDisplayFlags & VMMDEV_DISPLAY_ORIGIN)) 225 225 { 226 if ((idDisplay == 0) || (aDisplays[i].fDisplayFlags & VMMDEV_DISPLAY_ORIGIN)) 227 { 228 aRects[idDisplay].x = aDisplays[i].xOrigin; 229 aRects[idDisplay].y = aDisplays[i].yOrigin; 230 } else { 231 aRects[idDisplay].x = aRects[idDisplay - 1].x + aRects[idDisplay - 1].w; 232 aRects[idDisplay].y = aRects[idDisplay - 1].y; 233 } 234 aRects[idDisplay].w = aDisplays[i].cx; 235 aRects[idDisplay].h = aDisplays[i].cy; 226 aRects[cHeads].x = aDisplays[i].xOrigin; 227 aRects[cHeads].y = aDisplays[i].yOrigin; 228 } else { 229 aRects[cHeads].x = aRects[cHeads - 1].x + aRects[cHeads - 1].w; 230 aRects[cHeads].y = aRects[cHeads - 1].y; 236 231 } 232 aRects[cHeads].w = aDisplays[i].cx; 233 aRects[cHeads].h = aDisplays[i].cy; 234 ++cHeads; 237 235 } 238 236 } 239 for (i = 0; i < c DisplaysOut; ++i)237 for (i = 0; i < cHeads; ++i) 240 238 printf("Head %u: %dx%d, (%d, %d)\n", i, (int)aRects[i].w, (int)aRects[i].h, 241 239 (int)aRects[i].x, (int)aRects[i].y); 242 drmSendHints(&drmContext, aRects, VMW_MAX_HEADS);240 drmSendHints(&drmContext, aRects, cHeads); 243 241 } 244 242 do
Note:
See TracChangeset
for help on using the changeset viewer.