Changeset 69957 in vbox
- Timestamp:
- Dec 6, 2017 1:35:06 PM (7 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/VBoxFBOverlay.cpp
r69931 r69957 4447 4447 } 4448 4448 4449 #ifdef VBOX_WS_MAC4450 4449 /* Take the device-pixel-ratio into account: */ 4451 4450 if (mSizeInfo.useUnscaledHiDPIOutput()) … … 4460 4459 } 4461 4460 } 4462 #endif /* VBOX_WS_MAC */4463 4461 4464 4462 /* we do not to miss notify updates, because we have to update bg textures for it, -
trunk/src/VBox/Frontends/VirtualBox/src/main.cpp
r69824 r69957 398 398 qInstallMessageHandler(QtMessageOutput); 399 399 400 /* Enable HiDPI support: */ 401 QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); 402 QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); 403 400 404 /* Create application: */ 401 405 QApplication a(argc, argv); … … 412 416 413 417 #ifdef VBOX_WS_MAC 414 /* Enable HiDPI icons: */415 a.setAttribute(Qt::AA_UseHighDpiPixmaps);416 417 418 /* Disable menu icons on MacOS X host: */ 418 419 ::darwinDisableIconsInMenus(); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIFrameBuffer.cpp
r69931 r69957 1520 1520 } 1521 1521 1522 #ifdef VBOX_WS_MAC1523 1522 /* Should we 1524 1523 * not perform logical HiDPI scaling or … … 1529 1528 subPixmap.setDevicePixelRatio(dDevicePixelRatio); 1530 1529 } 1531 #endif /* VBOX_WS_MAC */1532 1530 } 1533 1531 … … 1578 1576 } 1579 1577 1580 #ifdef VBOX_WS_MAC1581 1578 /* Should we 1582 1579 * not perform logical HiDPI scaling or … … 1587 1584 subPixmap.setDevicePixelRatio(dDevicePixelRatio); 1588 1585 } 1589 #endif /* VBOX_WS_MAC */1590 1586 } 1591 1587 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp
r69931 r69957 439 439 rect.translate(-contentsX(), -contentsY()); 440 440 441 #ifdef VBOX_WS_MAC442 441 /* Take the device-pixel-ratio into account: */ 443 442 if (frameBuffer()->useUnscaledHiDPIOutput()) … … 452 451 } 453 452 } 454 #endif /* VBOX_WS_MAC */455 453 456 454 /* Limit the resulting part by the viewport rectangle: */ … … 631 629 , m_pFrameBuffer(0) 632 630 , m_previousState(KMachineState_Null) 633 #ifdef VBOX_WS_MAC634 631 , m_iHostScreenNumber(0) 635 #endif /* VBOX_WS_MAC */636 632 , m_maxGuestSizePolicy(MaxGuestResolutionPolicy_Automatic) 637 633 , m_u64MaxGuestSize(0) … … 705 701 m_pFrameBuffer->setScalingOptimizationType(gEDataManager->scalingOptimizationType(vboxGlobal().managedVMUuid())); 706 702 707 #ifdef VBOX_WS_MAC708 703 /* Take device-pixel-ratio into account: */ 709 704 m_pFrameBuffer->setDevicePixelRatio(gpDesktop->devicePixelRatio(machineWindow())); 710 #endif /* VBOX_WS_MAC */711 705 712 706 /* Take the scale-factor related attributes into account: */ … … 1120 1114 /* Finally copy the screen-shot to pause-pixmap: */ 1121 1115 m_pausePixmap = QPixmap::fromImage(screenShot); 1122 #ifdef VBOX_WS_MAC1123 1116 /* Adjust device-pixel-ratio if necessary: */ 1124 1117 const double dDevicePixelRatio = frameBuffer()->devicePixelRatio(); 1125 1118 if (dDevicePixelRatio > 1.0 && frameBuffer()->useUnscaledHiDPIOutput()) 1126 1119 m_pausePixmap.setDevicePixelRatio(dDevicePixelRatio); 1127 #endif /* VBOX_WS_MAC */1128 1120 1129 1121 /* Update scaled pause pixmap: */ … … 1155 1147 /* Finally copy the screen-shot to pause-pixmap: */ 1156 1148 m_pausePixmap = QPixmap::fromImage(screenShot); 1157 #ifdef VBOX_WS_MAC1158 1149 /* Adjust device-pixel-ratio if necessary: */ 1159 1150 const double dDevicePixelRatio = frameBuffer()->devicePixelRatio(); 1160 1151 if (dDevicePixelRatio > 1.0 && frameBuffer()->useUnscaledHiDPIOutput()) 1161 1152 m_pausePixmap.setDevicePixelRatio(dDevicePixelRatio); 1162 #endif /* VBOX_WS_MAC */1163 1153 1164 1154 /* Update scaled pause pixmap: */ … … 1179 1169 /* Update pause pixmap finally: */ 1180 1170 m_pausePixmapScaled = pausePixmap().scaled(scaledSize, Qt::IgnoreAspectRatio, Qt::SmoothTransformation); 1181 #ifdef VBOX_WS_MAC1182 1171 /* Adjust device-pixel-ratio if necessary: */ 1183 1172 const double dDevicePixelRatio = frameBuffer()->devicePixelRatio(); 1184 1173 if (dDevicePixelRatio > 1.0 && frameBuffer()->useUnscaledHiDPIOutput()) 1185 1174 m_pausePixmapScaled.setDevicePixelRatio(dDevicePixelRatio); 1186 #endif /* VBOX_WS_MAC */1187 1175 } 1188 1176 … … 1207 1195 int yRange = frameBufferSize.height() - curViewportSize.height(); 1208 1196 1209 #ifdef VBOX_WS_MAC 1210 /* Due to Qt 4.x doesn't supports HiDPI directly 1211 * we should take the device-pixel-ratio into account. 1212 * See also viewportToContents()... */ 1197 /* Take the device-pixel-ratio into account: */ 1213 1198 if (frameBuffer()->useUnscaledHiDPIOutput()) 1214 1199 { … … 1220 1205 } 1221 1206 } 1222 #endif /* VBOX_WS_MAC */1223 1207 1224 1208 /* Configure scroll-bars: */ … … 1235 1219 int iContentsY = contentsY(); 1236 1220 1237 #ifdef VBOX_WS_MAC 1238 /* Due to Qt 4.x doesn't supports HiDPI directly 1239 * we should take the device-pixel-ratio into account. 1240 * See also updateSliders()... */ 1221 /* Take the device-pixel-ratio into account: */ 1241 1222 if (frameBuffer()->useUnscaledHiDPIOutput()) 1242 1223 { … … 1248 1229 } 1249 1230 } 1250 #endif /* VBOX_WS_MAC */1251 1231 1252 1232 /* Return point shifted according scroll-bars: */ … … 1447 1427 break; 1448 1428 } 1449 #ifdef VBOX_WS_MAC1450 1429 case QEvent::Move: 1451 1430 { … … 1471 1450 break; 1472 1451 } 1473 #endif /* VBOX_WS_MAC */1474 1452 default: 1475 1453 break; … … 1868 1846 size = QSize((int)(size.width() * dScaleFactor), (int)(size.height() * dScaleFactor)); 1869 1847 1870 #ifdef VBOX_WS_MAC1871 1848 /* Take the device-pixel-ratio into account: */ 1872 1849 if (frameBuffer()->useUnscaledHiDPIOutput()) … … 1876 1853 size = QSize(size.width() / dDevicePixelRatio, size.height() / dDevicePixelRatio); 1877 1854 } 1878 #endif /* VBOX_WS_MAC */1879 1855 1880 1856 /* Return result: */ … … 1884 1860 QSize UIMachineView::scaledBackward(QSize size) const 1885 1861 { 1886 #ifdef VBOX_WS_MAC1887 1862 /* Take the device-pixel-ratio into account: */ 1888 1863 if (frameBuffer()->useUnscaledHiDPIOutput()) … … 1892 1867 size = QSize(size.width() * dDevicePixelRatio, size.height() * dDevicePixelRatio); 1893 1868 } 1894 #endif /* VBOX_WS_MAC */1895 1869 1896 1870 /* Take the scale-factor into account: */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.h
r69500 r69957 351 351 QSize m_sizeHintOverride; 352 352 353 #ifdef VBOX_WS_MAC354 353 /** Holds current host-screen number. */ 355 354 int m_iHostScreenNumber; 356 #endif /* VBOX_WS_MAC */357 355 358 356 /** The policy for calculating the maximum guest resolution which we wish -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMouseHandler.cpp
r69931 r69957 1044 1044 } 1045 1045 1046 #ifdef VBOX_WS_MAC1047 1046 /* Take the device-pixel-ratio into account: */ 1048 1047 if (pFrameBuffer->useUnscaledHiDPIOutput()) … … 1055 1054 } 1056 1055 } 1057 #endif /* VBOX_WS_MAC */1058 1056 1059 1057 #ifdef VBOX_WITH_DRAG_AND_DROP -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsDisplay.cpp
r68958 r69957 45 45 , m_cGuestScreenCount(0) 46 46 , m_dScaleFactor(1.0) 47 #ifdef VBOX_WS_MAC48 47 , m_fUseUnscaledHiDPIOutput(false) 49 #endif /* VBOX_WS_MAC */50 48 , m_f3dAccelerationEnabled(false) 51 49 #ifdef VBOX_WITH_VIDEOHWACCEL … … 75 73 && (m_cGuestScreenCount == other.m_cGuestScreenCount) 76 74 && (m_dScaleFactor == other.m_dScaleFactor) 77 #ifdef VBOX_WS_MAC78 75 && (m_fUseUnscaledHiDPIOutput == other.m_fUseUnscaledHiDPIOutput) 79 #endif /* VBOX_WS_MAC */80 76 && (m_f3dAccelerationEnabled == other.m_f3dAccelerationEnabled) 81 77 #ifdef VBOX_WITH_VIDEOHWACCEL … … 231 227 /** Holds the guest screen scale-factor. */ 232 228 double m_dScaleFactor; 233 #ifdef VBOX_WS_MAC234 229 /** Holds whether automatic Retina scaling is disabled. */ 235 230 bool m_fUseUnscaledHiDPIOutput; 236 #endif /* VBOX_WS_MAC */237 231 /** Holds whether the 3D acceleration is enabled. */ 238 232 bool m_f3dAccelerationEnabled; … … 353 347 oldDisplayData.m_cGuestScreenCount = m_machine.GetMonitorCount(); 354 348 oldDisplayData.m_dScaleFactor = gEDataManager->scaleFactor(m_machine.GetId()); 355 #ifdef VBOX_WS_MAC356 349 oldDisplayData.m_fUseUnscaledHiDPIOutput = gEDataManager->useUnscaledHiDPIOutput(m_machine.GetId()); 357 #endif358 350 oldDisplayData.m_f3dAccelerationEnabled = m_machine.GetAccelerate3DEnabled(); 359 351 #ifdef VBOX_WITH_VIDEOHWACCEL … … 403 395 m_pEditorVideoScreenCount->setValue(oldDisplayData.m_cGuestScreenCount); 404 396 m_pEditorGuestScreenScale->setValue((int)(oldDisplayData.m_dScaleFactor * 100)); 405 #ifdef VBOX_WS_MAC406 397 m_pCheckBoxUnscaledHiDPIOutput->setChecked(oldDisplayData.m_fUseUnscaledHiDPIOutput); 407 #endif408 398 m_pCheckbox3D->setChecked(oldDisplayData.m_f3dAccelerationEnabled); 409 399 #ifdef VBOX_WITH_VIDEOHWACCEL … … 452 442 newDisplayData.m_cGuestScreenCount = m_pEditorVideoScreenCount->value(); 453 443 newDisplayData.m_dScaleFactor = (double)m_pEditorGuestScreenScale->value() / 100; 454 #ifdef VBOX_WS_MAC455 444 newDisplayData.m_fUseUnscaledHiDPIOutput = m_pCheckBoxUnscaledHiDPIOutput->isChecked(); 456 #endif457 445 newDisplayData.m_f3dAccelerationEnabled = m_pCheckbox3D->isChecked(); 458 446 #ifdef VBOX_WITH_VIDEOHWACCEL … … 711 699 m_pLabelGuestScreenScaleMax->setEnabled(isMachineInValidMode()); 712 700 m_pEditorGuestScreenScale->setEnabled(isMachineInValidMode()); 713 #ifdef VBOX_WS_MAC714 701 m_pLabelHiDPI->setEnabled(isMachineInValidMode()); 715 702 m_pCheckBoxUnscaledHiDPIOutput->setEnabled(isMachineInValidMode()); 716 #else /* !VBOX_WS_MAC */717 m_pLabelHiDPI->hide();718 m_pCheckBoxUnscaledHiDPIOutput->hide();719 #endif /* !VBOX_WS_MAC */720 703 m_pLabelVideoOptions->setEnabled(isMachineOffline()); 721 704 m_pCheckbox3D->setEnabled(isMachineOffline()); … … 1414 1397 if (fSuccess && newDisplayData.m_dScaleFactor != oldDisplayData.m_dScaleFactor) 1415 1398 /* fSuccess = */ gEDataManager->setScaleFactor(newDisplayData.m_dScaleFactor, strMachineId); 1416 #ifdef VBOX_WS_MAC1417 1399 /* Save whether Unscaled HiDPI Output is enabled: : */ 1418 1400 if (fSuccess && newDisplayData.m_fUseUnscaledHiDPIOutput != oldDisplayData.m_fUseUnscaledHiDPIOutput) 1419 1401 /* fSuccess = */ gEDataManager->setUseUnscaledHiDPIOutput(newDisplayData.m_fUseUnscaledHiDPIOutput, strMachineId); 1420 #endif1421 1402 } 1422 1403 /* Return result: */
Note:
See TracChangeset
for help on using the changeset viewer.