Changeset 58011 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Oct 2, 2015 2:40:28 PM (9 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/runtime
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp
r57495 r58011 218 218 frameBuffer()->performRescale(); 219 219 220 // TODO: How to make it work? 220 /* Update console's display viewport and 3D overlay: */ 221 updateViewport(); 222 } 223 224 double UIMachineView::aspectRatio() const 225 { 226 return frameBuffer() ? (double)(frameBuffer()->width()) / frameBuffer()->height() : 0; 227 } 228 229 void UIMachineView::updateViewport() 230 { 221 231 display().ViewportChanged(screenId(), contentsX(), contentsY(), visibleWidth(), visibleHeight()); 222 }223 224 double UIMachineView::aspectRatio() const225 {226 return frameBuffer() ? (double)(frameBuffer()->width()) / frameBuffer()->height() : 0;227 232 } 228 233 … … 426 431 viewport()->update(); 427 432 428 / / TODO: How to make it work?429 display().ViewportChanged(screenId(), contentsX(), contentsY(), visibleWidth(), visibleHeight());433 /* Update console's display viewport and 3D overlay: */ 434 updateViewport(); 430 435 } 431 436 … … 480 485 viewport()->update(); 481 486 482 / / TODO: How to make it work?483 display().ViewportChanged(screenId(), contentsX(), contentsY(), visibleWidth(), visibleHeight());487 /* Update console's display viewport and 3D overlay: */ 488 updateViewport(); 484 489 } 485 490 … … 554 559 , m_pFrameBuffer(0) 555 560 , m_previousState(KMachineState_Null) 561 #ifdef Q_WS_MAC 562 , m_iHostScreenNumber(0) 563 #endif /* Q_WS_MAC */ 556 564 , m_maxGuestSizePolicy(MaxGuestSizePolicy_Invalid) 557 565 , m_u64MaxGuestSize(0) … … 1241 1249 QAbstractScrollArea::scrollContentsBy(dx, dy); 1242 1250 1243 display().ViewportChanged(screenId(), 1244 contentsX(), contentsY(), 1245 visibleWidth(), visibleHeight()); 1251 /* Update console's display viewport and 3D overlay: */ 1252 updateViewport(); 1246 1253 } 1247 1254 … … 1342 1349 m_pFrameBuffer->viewportResized(pResizeEvent); 1343 1350 #endif /* VBOX_WITH_VIDEOHWACCEL */ 1344 display().ViewportChanged(screenId(), 1345 contentsX(), contentsY(), 1346 visibleWidth(), visibleHeight()); 1351 /* Update console's display viewport and 3D overlay: */ 1352 updateViewport(); 1347 1353 break; 1348 1354 } … … 1358 1364 case QEvent::Move: 1359 1365 { 1360 /* In some cases viewport resize-events can provoke the 1361 * machine-view position changes inside the machine-window. 1362 * We have to notify interested listeners like 3D service. */ 1363 display().ViewportChanged(screenId(), 1364 contentsX(), contentsY(), 1365 visibleWidth(), visibleHeight()); 1366 /* Update console's display viewport and 3D overlay: */ 1367 updateViewport(); 1366 1368 break; 1367 1369 } … … 1394 1396 case QEvent::Move: 1395 1397 { 1396 if (m_pFrameBuffer) 1398 /* Get current host-screen number: */ 1399 const int iCurrentHostScreenNumber = vboxGlobal().screenNumber(this); 1400 if (m_iHostScreenNumber != iCurrentHostScreenNumber) 1397 1401 { 1398 /* Update backing-scale-factor for underlying frame-buffer: */ 1399 m_pFrameBuffer->setBackingScaleFactor(darwinBackingScaleFactor(machineWindow())); 1400 /* Perform frame-buffer rescaling: */ 1401 m_pFrameBuffer->performRescale(); 1402 /* Recache current host screen: */ 1403 m_iHostScreenNumber = iCurrentHostScreenNumber; 1404 1405 /* Update frame-buffer arguments: */ 1406 if (m_pFrameBuffer) 1407 { 1408 /* Update backing-scale-factor for underlying frame-buffer: */ 1409 m_pFrameBuffer->setBackingScaleFactor(darwinBackingScaleFactor(machineWindow())); 1410 /* Perform frame-buffer rescaling: */ 1411 m_pFrameBuffer->performRescale(); 1412 } 1413 1414 /* Update console's display viewport and 3D overlay: */ 1415 updateViewport(); 1402 1416 } 1403 1417 break; -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.h
r56704 r58011 108 108 double aspectRatio() const; 109 109 110 /** Updates console's display viewport. 111 * @remarks Used to update 3D-service overlay viewport as well. */ 112 void updateViewport(); 113 110 114 protected slots: 111 115 … … 181 185 /** Returns the session's console reference. */ 182 186 CConsole& console() const; 183 /** Returns the display's display reference. */187 /** Returns the console's display reference. */ 184 188 CDisplay& display() const; 185 189 /** Returns the console's guest reference. */ … … 349 353 QSize m_sizeHintOverride; 350 354 355 #ifdef Q_WS_MAC 356 /** Holds current host-screen number. */ 357 int m_iHostScreenNumber; 358 #endif /* Q_WS_MAC */ 359 351 360 /** The policy for calculating the maximum guest resolution which we wish 352 361 * to handle. */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineWindowFullscreen.cpp
r57591 r58011 82 82 LogRel(("UIMachineWindowFullscreen::handleNativeNotification: " 83 83 "Native fullscreen mode entered, notifying listener...\n")); 84 /* Update console's display viewport and 3D overlay: */ 85 machineView()->updateViewport(); 84 86 emit sigNotifyAboutNativeFullscreenDidEnter(); 85 87 } … … 98 100 LogRel(("UIMachineWindowFullscreen::handleNativeNotification: " 99 101 "Native fullscreen mode exited, notifying listener...\n")); 102 /* Update console's display viewport and 3D overlay: */ 103 machineView()->updateViewport(); 100 104 emit sigNotifyAboutNativeFullscreenDidExit(); 101 105 } -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineViewScale.cpp
r57591 r58011 146 146 frameBuffer()->performRescale(); 147 147 148 / / TODO: How to make it work?149 display().ViewportChanged(screenId(), contentsX(), contentsY(), visibleWidth(), visibleHeight());148 /* Update console's display viewport and 3D overlay: */ 149 updateViewport(); 150 150 } 151 151
Note:
See TracChangeset
for help on using the changeset viewer.