Changeset 53861 in vbox
- Timestamp:
- Jan 19, 2015 6:36:27 PM (10 years ago)
- svn:sync-xref-src-repo-rev:
- 97695
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.cpp
r53462 r53861 3588 3588 else if (strKey == GUI_ScaleFactor) 3589 3589 emit sigScaleFactorChange(strMachineID); 3590 #ifdef RT_OS_DARWIN3591 3590 else if (strKey == GUI_HiDPI_UnscaledOutput) 3592 3591 emit sigUnscaledHiDPIOutputModeChange(strMachineID); 3593 #endif /* RT_OS_DARWIN */3594 3592 } 3595 3593 -
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.h
r53461 r53861 79 79 void sigScaleFactorChange(const QString &strMachineID); 80 80 81 /** Notifies about unscaled HiDPI output mode change. */ 82 void sigUnscaledHiDPIOutputModeChange(const QString &strMachineID); 83 81 84 #ifdef RT_OS_DARWIN 82 /** Mac OS X: Notifies about unscaled HiDPI output mode change. */83 void sigUnscaledHiDPIOutputModeChange(const QString &strMachineID);84 85 85 /** Mac OS X: Notifies about 'presentation mode' status change. */ 86 86 void sigPresentationModeChange(bool fEnabled); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIFrameBuffer.cpp
r53860 r53861 790 790 } 791 791 792 #ifdef RT_OS_DARWIN 793 void UIFrameBuffer::sltHandleUnscaledHiDPIOutputModeChange(const QString &strMachineID) 794 { 795 /* Skip unrelated machine IDs: */ 796 if (strMachineID != vboxGlobal().managedVMUuid()) 797 return; 798 799 /* Fetch new unscaled HiDPI output mode value: */ 800 m_fUseUnscaledHiDPIOutput = gEDataManager->useUnscaledHiDPIOutput(vboxGlobal().managedVMUuid()); 792 void UIFrameBuffer::setUseUnscaledHiDPIOutput(bool fUseUnscaledHiDPIOutput) 793 { 794 /* Remember new use-unscaled-HiDPI-output value: */ 795 m_fUseUnscaledHiDPIOutput = fUseUnscaledHiDPIOutput; 801 796 802 797 /* Update coordinate-system: */ 803 798 updateCoordinateSystem(); 804 799 } 805 #endif /* RT_OS_DARWIN */806 800 807 801 void UIFrameBuffer::prepareConnections() … … 820 814 m_pMachineView, SLOT(sltHandle3DOverlayVisibilityChange(bool)), 821 815 Qt::QueuedConnection); 822 823 /* Extra-data manager connections: */824 #ifdef Q_WS_MAC825 connect(gEDataManager, SIGNAL(sigUnscaledHiDPIOutputModeChange(const QString&)),826 this, SLOT(sltHandleUnscaledHiDPIOutputModeChange(const QString&)));827 #endif /* Q_WS_MAC */828 816 } 829 817 … … 839 827 disconnect(this, SIGNAL(sigNotifyAbout3DOverlayVisibilityChange(bool)), 840 828 m_pMachineView, SLOT(sltHandle3DOverlayVisibilityChange(bool))); 841 842 /* Extra-data manager connections: */843 #ifdef Q_WS_MAC844 disconnect(gEDataManager, SIGNAL(sigUnscaledHiDPIOutputModeChange(const QString&)),845 this, SLOT(sltHandleUnscaledHiDPIOutputModeChange(const QString&)));846 #endif /* Q_WS_MAC */847 829 } 848 830 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIFrameBuffer.h
r53860 r53861 226 226 /** Returns whether frame-buffer should use unscaled HiDPI output. */ 227 227 bool useUnscaledHiDPIOutput() const { return m_fUseUnscaledHiDPIOutput; } 228 /** Defines whether frame-buffer should use unscaled HiDPI output. */ 229 void setUseUnscaledHiDPIOutput(bool fUseUnscaledHiDPIOutput); 228 230 229 231 /** Return HiDPI frame-buffer optimization type. */ … … 231 233 /** Define HiDPI frame-buffer optimization type: */ 232 234 void setHiDPIOptimizationType(HiDPIOptimizationType optimizationType) { m_hiDPIOptimizationType = optimizationType; } 233 234 protected slots:235 236 #ifdef RT_OS_DARWIN237 /** Mac OS X: Handles the unscaled HiDPI output mode change. */238 void sltHandleUnscaledHiDPIOutputModeChange(const QString &strMachineID);239 #endif /* RT_OS_DARWIN */240 235 241 236 protected: -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp
r53859 r53861 234 234 frameBuffer()->setScaledSize(size()); 235 235 } 236 /* Adjust other modes to current NotifyChange event size: */237 else238 {239 /* Assign new frame-buffer logical-size taking the scale-factor into account: */240 const double dScaleFactor = gEDataManager->scaleFactor(vboxGlobal().managedVMUuid());241 frameBuffer()->setScaleFactor(dScaleFactor);242 display().NotifyScaleFactorChange(m_uScreenId,243 (uint32_t)(dScaleFactor * VBOX_OGL_SCALE_FACTOR_MULTIPLIER),244 (uint32_t)(dScaleFactor * VBOX_OGL_SCALE_FACTOR_MULTIPLIER));245 }246 236 247 237 /* Perform frame-buffer mode-change: */ … … 355 345 return; 356 346 347 /* Take the scale-factor into account: */ 348 const double dScaleFactor = gEDataManager->scaleFactor(vboxGlobal().managedVMUuid()); 349 frameBuffer()->setScaleFactor(dScaleFactor); 350 display().NotifyScaleFactorChange(m_uScreenId, 351 (uint32_t)(dScaleFactor * VBOX_OGL_SCALE_FACTOR_MULTIPLIER), 352 (uint32_t)(dScaleFactor * VBOX_OGL_SCALE_FACTOR_MULTIPLIER)); 353 357 354 /* Adjust frame-buffer, machine-window and guest-screen size if necessary: */ 358 355 sltHandleNotifyChange(frameBuffer()->width(), frameBuffer()->height()); … … 362 359 } 363 360 364 #ifdef RT_OS_DARWIN365 361 void UIMachineView::sltHandleUnscaledHiDPIOutputModeChange(const QString &strMachineID) 366 362 { … … 368 364 if (strMachineID != vboxGlobal().managedVMUuid()) 369 365 return; 366 367 /* Take unscaled HiDPI output mode into account: */ 368 const bool fUseUnscaledHiDPIOutput = gEDataManager->useUnscaledHiDPIOutput(vboxGlobal().managedVMUuid()); 369 frameBuffer()->setUseUnscaledHiDPIOutput(fUseUnscaledHiDPIOutput); 370 370 371 371 /* Adjust frame-buffer, machine-window and guest-screen size if necessary: */ … … 375 375 adjustGuestScreenSize(); 376 376 } 377 #endif /* RT_OS_DARWIN */378 377 379 378 void UIMachineView::sltMachineStateChanged() … … 478 477 void UIMachineView::prepareFrameBuffer() 479 478 { 480 /* Take scale-factor into account: */479 /* Take scale-factor and unscaled video output mode into account: */ 481 480 const double dScaleFactor = gEDataManager->scaleFactor(vboxGlobal().managedVMUuid()); 481 const bool fUseUnscaledHiDPIOutput = gEDataManager->useUnscaledHiDPIOutput(vboxGlobal().managedVMUuid()); 482 482 483 483 /* Prepare frame-buffer: */ … … 515 515 (uint32_t)(dScaleFactor * VBOX_OGL_SCALE_FACTOR_MULTIPLIER), 516 516 (uint32_t)(dScaleFactor * VBOX_OGL_SCALE_FACTOR_MULTIPLIER)); 517 m_pFrameBuffer->setUseUnscaledHiDPIOutput(fUseUnscaledHiDPIOutput); 517 518 uisession()->setFrameBuffer(screenId(), m_pFrameBuffer); 518 519 } … … 561 562 (uint32_t)(dScaleFactor * VBOX_OGL_SCALE_FACTOR_MULTIPLIER), 562 563 (uint32_t)(dScaleFactor * VBOX_OGL_SCALE_FACTOR_MULTIPLIER)); 564 frameBuffer()->setUseUnscaledHiDPIOutput(fUseUnscaledHiDPIOutput); 563 565 } 564 566 } … … 604 606 connect(gEDataManager, SIGNAL(sigScaleFactorChange(const QString&)), 605 607 this, SLOT(sltHandleScaleFactorChange(const QString&))); 606 #ifdef Q_WS_MAC607 608 /* Unscaled HiDPI output mode change: */ 608 609 connect(gEDataManager, SIGNAL(sigUnscaledHiDPIOutputModeChange(const QString&)), 609 610 this, SLOT(sltHandleUnscaledHiDPIOutputModeChange(const QString&))); 610 #endif /* Q_WS_MAC */611 611 } 612 612 … … 1136 1136 case QEvent::Move: 1137 1137 { 1138 /* Update backing scalefactor for underlying frame-buffer: */1138 /* Update backing-scale-factor for underlying frame-buffer: */ 1139 1139 if (m_pFrameBuffer) 1140 1140 m_pFrameBuffer->setBackingScaleFactor(darwinBackingScaleFactor(machineWindow())); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.h
r53461 r53861 117 117 void sltHandleScaleFactorChange(const QString &strMachineID); 118 118 119 #ifdef RT_OS_DARWIN 120 /** Mac OS X: Handles the unscaled HiDPI output mode change. */ 119 /** Handles the unscaled HiDPI output mode change. */ 121 120 void sltHandleUnscaledHiDPIOutputModeChange(const QString &strMachineID); 122 #endif /* RT_OS_DARWIN */123 121 124 122 /* Console callback handlers: */
Note:
See TracChangeset
for help on using the changeset viewer.