Changeset 71104 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Feb 22, 2018 2:14:16 PM (7 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.cpp
r71056 r71104 155 155 const char* UIExtraDataDefs::GUI_Accelerate2D_PixformatAYUV = "GUI/Accelerate2D/PixformatAYUV"; 156 156 #endif /* VBOX_WITH_VIDEOHWACCEL */ 157 const char* UIExtraDataDefs::GUI_HiDPI_UnscaledOutput = "GUI/HiDPI/UnscaledOutput";158 157 #ifndef VBOX_WS_MAC 159 158 const char* UIExtraDataDefs::GUI_ShowMiniToolBar = "GUI/ShowMiniToolBar"; -
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.h
r71056 r71104 278 278 extern const char* GUI_Accelerate2D_PixformatAYUV; 279 279 #endif /* VBOX_WITH_VIDEOHWACCEL */ 280 /** Holds whether Runtime UI should use unscaled HiDPI output. */281 extern const char* GUI_HiDPI_UnscaledOutput;282 280 #ifndef VBOX_WS_MAC 283 281 /** Holds whether mini-toolbar is enabled for full and seamless screens. */ -
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.cpp
r71056 r71104 1996 1996 << GUI_Accelerate2D_PixformatYUY2 << GUI_Accelerate2D_PixformatAYUV 1997 1997 #endif /* VBOX_WITH_VIDEOHWACCEL */ 1998 << GUI_HiDPI_UnscaledOutput1999 1998 #ifndef VBOX_WS_MAC 2000 1999 << GUI_ShowMiniToolBar << GUI_MiniToolBarAutoHide << GUI_MiniToolBarAlignment … … 3720 3719 } 3721 3720 #endif /* VBOX_WITH_VIDEOHWACCEL */ 3722 3723 bool UIExtraDataManager::useUnscaledHiDPIOutput(const QString &strID)3724 {3725 #ifdef VBOX_WS_MAC3726 /* 'False' unless feature allowed: */3727 return isFeatureAllowed(GUI_HiDPI_UnscaledOutput, strID);3728 #else3729 /* 'True' unless feature restricted: */3730 return !isFeatureRestricted(GUI_HiDPI_UnscaledOutput, strID);3731 #endif3732 }3733 3734 void UIExtraDataManager::setUseUnscaledHiDPIOutput(bool fUseUnscaledHiDPIOutput, const QString &strID)3735 {3736 #ifdef VBOX_WS_MAC3737 /* 'True' if feature allowed, null-string otherwise: */3738 setExtraDataString(GUI_HiDPI_UnscaledOutput, toFeatureAllowed(fUseUnscaledHiDPIOutput), strID);3739 #else3740 /* 'False' if feature restricted, null-string otherwise: */3741 setExtraDataString(GUI_HiDPI_UnscaledOutput, toFeatureRestricted(!fUseUnscaledHiDPIOutput), strID);3742 #endif3743 }3744 3721 3745 3722 #ifndef VBOX_WS_MAC … … 4409 4386 else if (strKey == GUI_Scaling_Optimization) 4410 4387 emit sigScalingOptimizationTypeChange(strMachineID); 4411 /* Unscaled HiDPI Output mode change: */4412 else if (strKey == GUI_HiDPI_UnscaledOutput)4413 emit sigUnscaledHiDPIOutputModeChange(strMachineID);4414 4388 } 4415 4389 -
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.h
r71056 r71104 89 89 void sigHiDPIOptimizationTypeChange(const QString &strMachineID); 90 90 #endif 91 92 /** Notifies about unscaled HiDPI output mode change. */93 void sigUnscaledHiDPIOutputModeChange(const QString &strMachineID);94 91 95 92 #ifdef RT_OS_DARWIN … … 529 526 bool usePixelFormatAYUV(const QString &strID); 530 527 #endif /* VBOX_WITH_VIDEOHWACCEL */ 531 532 /** Returns whether Runtime UI should use unscaled HiDPI output. */533 bool useUnscaledHiDPIOutput(const QString &strID);534 /** Defines whether Runtime UI should @a fUseUnscaledHiDPIOutput. */535 void setUseUnscaledHiDPIOutput(bool fUseUnscaledHiDPIOutput, const QString &strID);536 528 537 529 #ifndef VBOX_WS_MAC -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp
r71080 r71104 249 249 /* Take the scale-factor related attributes into account: */ 250 250 const double dScaleFactor = gEDataManager->scaleFactor(vboxGlobal().managedVMUuid()); 251 const bool fUseUnscaledHiDPIOutput = gEDataManager->useUnscaledHiDPIOutput(vboxGlobal().managedVMUuid()); 251 #ifdef VBOX_WS_MAC 252 const bool fUseUnscaledHiDPIOutput = false; 253 #else 254 const bool fUseUnscaledHiDPIOutput = true; 255 #endif 252 256 frameBuffer()->setScaleFactor(dScaleFactor); 253 257 frameBuffer()->setUseUnscaledHiDPIOutput(fUseUnscaledHiDPIOutput); … … 502 506 /* Take the scale-factor into account: */ 503 507 const double dScaleFactor = gEDataManager->scaleFactor(vboxGlobal().managedVMUuid()); 504 const bool fUseUnscaledHiDPIOutput = gEDataManager->useUnscaledHiDPIOutput(vboxGlobal().managedVMUuid()); 508 #ifdef VBOX_WS_MAC 509 const bool fUseUnscaledHiDPIOutput = false; 510 #else 511 const bool fUseUnscaledHiDPIOutput = true; 512 #endif 505 513 Q_UNUSED(fUseUnscaledHiDPIOutput); 506 514 frameBuffer()->setScaleFactor(dScaleFactor); … … 546 554 /* Update viewport: */ 547 555 viewport()->update(); 548 }549 550 void UIMachineView::sltHandleUnscaledHiDPIOutputModeChange(const QString &strMachineID)551 {552 /* Skip unrelated machine IDs: */553 if (strMachineID != vboxGlobal().managedVMUuid())554 return;555 556 /* Take the unscaled HiDPI output mode into account: */557 const bool fUseUnscaledHiDPIOutput = gEDataManager->useUnscaledHiDPIOutput(vboxGlobal().managedVMUuid());558 frameBuffer()->setUseUnscaledHiDPIOutput(fUseUnscaledHiDPIOutput);559 /* Propagate the unscaled HiDPI output mode to 3D service if necessary: */560 if (machine().GetAccelerate3DEnabled() && vboxGlobal().is3DAvailable())561 display().NotifyHiDPIOutputPolicyChange(fUseUnscaledHiDPIOutput);562 563 /* Handle scale attributes change: */564 handleScaleChange();565 /* Adjust guest-screen size: */566 adjustGuestScreenSize();567 568 /* Update scaled pause pixmap, if necessary: */569 updateScaledPausePixmap();570 viewport()->update();571 572 /* Update console's display viewport and 3D overlay: */573 updateViewport();574 556 } 575 557 … … 717 699 const double dDevicePixelRatioActual = gpDesktop->devicePixelRatioActual(machineWindow()); 718 700 const double dScaleFactor = gEDataManager->scaleFactor(vboxGlobal().managedVMUuid()); 719 const bool fUseUnscaledHiDPIOutput = gEDataManager->useUnscaledHiDPIOutput(vboxGlobal().managedVMUuid()); 701 #ifdef VBOX_WS_MAC 702 const bool fUseUnscaledHiDPIOutput = false; 703 #else 704 const bool fUseUnscaledHiDPIOutput = true; 705 #endif 720 706 m_pFrameBuffer->setDevicePixelRatio(dDevicePixelRatioFormal); 721 707 m_pFrameBuffer->setDevicePixelRatioActual(dDevicePixelRatioActual); … … 837 823 connect(gEDataManager, SIGNAL(sigScalingOptimizationTypeChange(const QString&)), 838 824 this, SLOT(sltHandleScalingOptimizationChange(const QString&))); 839 /* Unscaled HiDPI output mode change: */840 connect(gEDataManager, SIGNAL(sigUnscaledHiDPIOutputModeChange(const QString&)),841 this, SLOT(sltHandleUnscaledHiDPIOutputModeChange(const QString&)));842 825 } 843 826 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.h
r71056 r71104 131 131 /** Handles the scaling-optimization change. */ 132 132 void sltHandleScalingOptimizationChange(const QString &strMachineID); 133 134 /** Handles the unscaled HiDPI output mode change. */135 void sltHandleUnscaledHiDPIOutputModeChange(const QString &strMachineID);136 133 137 134 /* Console callback handlers: */ -
trunk/src/VBox/Frontends/VirtualBox/src/selector/UISnapshotDetailsWidget.cpp
r71027 r71104 1288 1288 } 1289 1289 1290 #ifdef VBOX_WS_MAC1291 /* Unscaled HiDPI Video Output? */1292 const QString strUnscaledOutput = unscaledOutputReport(comMachine);1293 const QString strUnscaledOutputOld = unscaledOutputReport(comMachineOld);1294 if (!strUnscaledOutput.isNull())1295 {1296 ++iRowCount;1297 strItem += QString(sSectionItemTpl2).arg(QApplication::translate("UIGDetails", "Unscaled HiDPI Video Output", "details (display)"),1298 empReport(strUnscaledOutput, strUnscaledOutputOld));1299 }1300 #endif /* VBOX_WS_MAC */1301 1302 1290 /* Acceleration? */ 1303 1291 const QString strAcceleration = displayAccelerationReport(comMachine); … … 1663 1651 return dReport; 1664 1652 } 1665 1666 #ifdef VBOX_WS_MAC1667 /* static */1668 QString UISnapshotDetailsWidget::unscaledOutputReport(CMachine comMachine)1669 {1670 // WORKAROUND:1671 // IMachine::GetExtraData still non-const..1672 CMachine comExtraDataMachine = comMachine;1673 /* Prepare report: */1674 QString strReport;1675 /* Acquire Unscaled Output mode: */1676 const QString strValue = comExtraDataMachine.GetExtraData(UIExtraDataDefs::GUI_HiDPI_UnscaledOutput);1677 {1678 /* Try to convert loaded data to bool: */1679 const bool fEnabled = strValue.compare("true", Qt::CaseInsensitive) == 0 ||1680 strValue.compare("yes", Qt::CaseInsensitive) == 0 ||1681 strValue.compare("on", Qt::CaseInsensitive) == 0 ||1682 strValue == "1";1683 /* Append information: */1684 if (fEnabled)1685 strReport = QApplication::translate("UIGDetails", "Enabled", "details (display/Unscaled HiDPI Video Output)");1686 else1687 /* strReport = */ QApplication::translate("UIGDetails", "Disabled", "details (display/Unscaled HiDPI Video Output)");1688 }1689 /* Return report: */1690 return strReport;1691 }1692 #endif /* VBOX_WS_MAC */1693 1653 1694 1654 /* static */ -
trunk/src/VBox/Frontends/VirtualBox/src/selector/UISnapshotDetailsWidget.h
r71027 r71104 158 158 /** Acquires @a comMachine scale-factor report. */ 159 159 static double scaleFactorReport(CMachine comMachine); 160 #ifdef VBOX_WS_MAC161 /** Acquires @a comMachine unscaled output report. */162 static QString unscaledOutputReport(CMachine comMachine);163 #endif /* VBOX_WS_MAC */164 160 /** Acquires @a comMachine display acceleration report. */ 165 161 static QString displayAccelerationReport(CMachine comMachine); -
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetailsElements.cpp
r69500 r71104 419 419 QString::number(dValue, 'f', 2)); 420 420 } 421 422 #ifdef VBOX_WS_MAC423 /* Get 'Unscaled HiDPI Video Output' mode value: */424 const QString strUnscaledHiDPIMode = machine.GetExtraData(UIExtraDataDefs::GUI_HiDPI_UnscaledOutput);425 {426 /* Try to convert loaded data to bool: */427 const bool fEnabled = strUnscaledHiDPIMode.compare("true", Qt::CaseInsensitive) == 0 ||428 strUnscaledHiDPIMode.compare("yes", Qt::CaseInsensitive) == 0 ||429 strUnscaledHiDPIMode.compare("on", Qt::CaseInsensitive) == 0 ||430 strUnscaledHiDPIMode == "1";431 /* Append information: */432 if (fEnabled)433 table << UITextTableLine(QApplication::translate("UIGDetails", "Unscaled HiDPI Video Output", "details (display)"),434 QApplication::translate("UIGDetails", "Enabled", "details (display/Unscaled HiDPI Video Output)"));435 }436 #endif /* VBOX_WS_MAC */437 421 438 422 QStringList acceleration; -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsDisplay.cpp
r71027 r71104 45 45 , m_cGuestScreenCount(0) 46 46 , m_dScaleFactor(1.0) 47 , m_fUseUnscaledHiDPIOutput(false)48 47 , m_f3dAccelerationEnabled(false) 49 48 #ifdef VBOX_WITH_VIDEOHWACCEL … … 73 72 && (m_cGuestScreenCount == other.m_cGuestScreenCount) 74 73 && (m_dScaleFactor == other.m_dScaleFactor) 75 && (m_fUseUnscaledHiDPIOutput == other.m_fUseUnscaledHiDPIOutput)76 74 && (m_f3dAccelerationEnabled == other.m_f3dAccelerationEnabled) 77 75 #ifdef VBOX_WITH_VIDEOHWACCEL … … 227 225 /** Holds the guest screen scale-factor. */ 228 226 double m_dScaleFactor; 229 /** Holds whether automatic Retina scaling is disabled. */230 bool m_fUseUnscaledHiDPIOutput;231 227 /** Holds whether the 3D acceleration is enabled. */ 232 228 bool m_f3dAccelerationEnabled; … … 347 343 oldDisplayData.m_cGuestScreenCount = m_machine.GetMonitorCount(); 348 344 oldDisplayData.m_dScaleFactor = gEDataManager->scaleFactor(m_machine.GetId()); 349 oldDisplayData.m_fUseUnscaledHiDPIOutput = gEDataManager->useUnscaledHiDPIOutput(m_machine.GetId());350 345 oldDisplayData.m_f3dAccelerationEnabled = m_machine.GetAccelerate3DEnabled(); 351 346 #ifdef VBOX_WITH_VIDEOHWACCEL … … 395 390 m_pEditorVideoScreenCount->setValue(oldDisplayData.m_cGuestScreenCount); 396 391 m_pEditorGuestScreenScale->setValue((int)(oldDisplayData.m_dScaleFactor * 100)); 397 m_pCheckBoxUnscaledHiDPIOutput->setChecked(oldDisplayData.m_fUseUnscaledHiDPIOutput);398 392 m_pCheckbox3D->setChecked(oldDisplayData.m_f3dAccelerationEnabled); 399 393 #ifdef VBOX_WITH_VIDEOHWACCEL … … 442 436 newDisplayData.m_cGuestScreenCount = m_pEditorVideoScreenCount->value(); 443 437 newDisplayData.m_dScaleFactor = (double)m_pEditorGuestScreenScale->value() / 100; 444 newDisplayData.m_fUseUnscaledHiDPIOutput = m_pCheckBoxUnscaledHiDPIOutput->isChecked();445 438 newDisplayData.m_f3dAccelerationEnabled = m_pCheckbox3D->isChecked(); 446 439 #ifdef VBOX_WITH_VIDEOHWACCEL … … 618 611 setTabOrder(m_pEditorVideoScreenCount, m_pSliderGuestScreenScale); 619 612 setTabOrder(m_pSliderGuestScreenScale, m_pEditorGuestScreenScale); 620 setTabOrder(m_pEditorGuestScreenScale, m_pCheckBoxUnscaledHiDPIOutput); 621 setTabOrder(m_pCheckBoxUnscaledHiDPIOutput, m_pCheckbox3D); 613 setTabOrder(m_pEditorGuestScreenScale, m_pCheckbox3D); 622 614 #ifdef VBOX_WITH_VIDEOHWACCEL 623 615 setTabOrder(m_pCheckbox3D, m_pCheckbox2DVideo); … … 699 691 m_pLabelGuestScreenScaleMax->setEnabled(isMachineInValidMode()); 700 692 m_pEditorGuestScreenScale->setEnabled(isMachineInValidMode()); 701 m_pLabelHiDPI->setEnabled(isMachineInValidMode());702 m_pCheckBoxUnscaledHiDPIOutput->setEnabled(isMachineInValidMode());703 693 m_pLabelVideoOptions->setEnabled(isMachineOffline()); 704 694 m_pCheckbox3D->setEnabled(isMachineOffline()); … … 1397 1387 if (fSuccess && newDisplayData.m_dScaleFactor != oldDisplayData.m_dScaleFactor) 1398 1388 /* fSuccess = */ gEDataManager->setScaleFactor(newDisplayData.m_dScaleFactor, strMachineId); 1399 /* Save whether Unscaled HiDPI Output is enabled: : */1400 if (fSuccess && newDisplayData.m_fUseUnscaledHiDPIOutput != oldDisplayData.m_fUseUnscaledHiDPIOutput)1401 /* fSuccess = */ gEDataManager->setUseUnscaledHiDPIOutput(newDisplayData.m_fUseUnscaledHiDPIOutput, strMachineId);1402 1389 } 1403 1390 /* Return result: */ -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsDisplay.ui
r71027 r71104 203 203 </item> 204 204 <item row="6" column="0"> 205 <widget class="QLabel" name="m_pLabelHiDPI">206 <property name="text">207 <string>HiDPI Support:</string>208 </property>209 <property name="alignment">210 <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>211 </property>212 </widget>213 </item>214 <item row="6" column="1">215 <widget class="QCheckBox" name="m_pCheckBoxUnscaledHiDPIOutput">216 <property name="sizePolicy">217 <sizepolicy vsizetype="Fixed" hsizetype="MinimumExpanding">218 <horstretch>0</horstretch>219 <verstretch>0</verstretch>220 </sizepolicy>221 </property>222 <property name="whatsThis">223 <string>When checked, guest screen contents will not be scaled up to compensate for high host screen resolutions.</string>224 </property>225 <property name="text">226 <string>Use &Unscaled HiDPI Output</string>227 </property>228 </widget>229 </item>230 <item row="7" column="0">231 205 <widget class="QLabel" name="m_pLabelVideoOptions"> 232 206 <property name="text"> … … 238 212 </widget> 239 213 </item> 240 <item row=" 7" column="1">214 <item row="6" column="1"> 241 215 <widget class="QCheckBox" name="m_pCheckbox3D"> 242 216 <property name="sizePolicy"> … … 254 228 </widget> 255 229 </item> 256 <item row=" 8" column="1">230 <item row="7" column="1"> 257 231 <widget class="QCheckBox" name="m_pCheckbox2DVideo"> 258 232 <property name="sizePolicy">
Note:
See TracChangeset
for help on using the changeset viewer.