Changeset 53912 in vbox for trunk/src/VBox
- Timestamp:
- Jan 22, 2015 11:52:40 AM (10 years ago)
- svn:sync-xref-src-repo-rev:
- 97784
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/runtime
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp
r53910 r53912 195 195 AssertMsg(size.isValid(), ("Size should be valid!\n")); 196 196 197 #ifdef Q_WS_MAC 198 /* Take the backing-scale-factor into account: */ 199 if (gEDataManager->useUnscaledHiDPIOutput(vboxGlobal().managedVMUuid())) 200 { 201 const double dBackingScaleFactor = darwinBackingScaleFactor(machineWindow()); 202 if (dBackingScaleFactor > 1.0) 203 size = QSize(size.width() * dBackingScaleFactor, size.height() * dBackingScaleFactor); 204 } 205 #endif /* Q_WS_MAC */ 206 207 /* Take the scale-factor into account: */ 208 const double dScaleFactor = gEDataManager->scaleFactor(vboxGlobal().managedVMUuid()); 209 if (dScaleFactor != 1.0) 210 size = QSize(size.width() / dScaleFactor, size.height() / dScaleFactor); 197 /* Take the scale-factor(s) into account: */ 198 size = scaledBackward(size); 211 199 212 200 /* Expand current limitations: */ … … 744 732 QSize size(m_pFrameBuffer->width(), m_pFrameBuffer->height()); 745 733 746 /* Take the scale-factor into account: */ 747 const double dScaleFactor = gEDataManager->scaleFactor(vboxGlobal().managedVMUuid()); 748 if (dScaleFactor != 1.0) 749 size = QSize(size.width() * dScaleFactor, size.height() * dScaleFactor); 750 751 #ifdef Q_WS_MAC 752 /* Take the backing-scale-factor into account: */ 753 if (gEDataManager->useUnscaledHiDPIOutput(vboxGlobal().managedVMUuid())) 754 { 755 const double dBackingScaleFactor = darwinBackingScaleFactor(machineWindow()); 756 if (dBackingScaleFactor > 1.0) 757 size = QSize(size.width() / dBackingScaleFactor, size.height() / dBackingScaleFactor); 758 } 759 #endif /* Q_WS_MAC */ 734 /* Take the scale-factor(s) into account: */ 735 size = scaledForward(size); 760 736 761 737 #ifdef VBOX_WITH_DEBUGGER_GUI … … 839 815 size = QSize(800, 600); 840 816 841 /* Take the scale-factor into account: */ 842 const double dScaleFactor = gEDataManager->scaleFactor(vboxGlobal().managedVMUuid()); 843 if (dScaleFactor != 1.0) 844 size = QSize(size.width() * dScaleFactor, size.height() * dScaleFactor); 845 846 #ifdef Q_WS_MAC 847 /* Take the backing-scale-factor into account: */ 848 if (gEDataManager->useUnscaledHiDPIOutput(vboxGlobal().managedVMUuid())) 849 { 850 const double dBackingScaleFactor = darwinBackingScaleFactor(machineWindow()); 851 if (dBackingScaleFactor > 1.0) 852 size = QSize(size.width() / dBackingScaleFactor, size.height() / dBackingScaleFactor); 853 } 854 #endif /* Q_WS_MAC */ 817 /* Take the scale-factor(s) into account: */ 818 size = scaledForward(size); 855 819 856 820 /* Return size: */ … … 983 947 QSize v = QSize(frameBuffer()->width(), frameBuffer()->height()); 984 948 985 /* Take the scale-factor into account: */ 986 const double dScaleFactor = gEDataManager->scaleFactor(vboxGlobal().managedVMUuid()); 987 if (dScaleFactor != 1.0) 988 v = QSize(v.width() * dScaleFactor, v.height() * dScaleFactor); 989 990 #ifdef Q_WS_MAC 991 /* Take the backing-scale-factor into account: */ 992 if (gEDataManager->useUnscaledHiDPIOutput(vboxGlobal().managedVMUuid())) 993 { 994 const double dBackingScaleFactor = darwinBackingScaleFactor(machineWindow()); 995 if (dBackingScaleFactor > 1.0) 996 v = QSize(v.width() / dBackingScaleFactor, v.height() / dBackingScaleFactor); 997 } 998 #endif /* Q_WS_MAC */ 949 /* Take the scale-factor(s) into account: */ 950 v = scaledForward(v); 999 951 1000 952 /* No scroll bars needed: */ … … 1421 1373 #endif /* Q_WS_X11 */ 1422 1374 1375 QSize UIMachineView::scaledForward(QSize size) const 1376 { 1377 /* Take the scale-factor into account: */ 1378 const double dScaleFactor = gEDataManager->scaleFactor(vboxGlobal().managedVMUuid()); 1379 if (dScaleFactor != 1.0) 1380 size = QSize(size.width() * dScaleFactor, size.height() * dScaleFactor); 1381 1382 #ifdef Q_WS_MAC 1383 /* Take the backing-scale-factor into account: */ 1384 if (gEDataManager->useUnscaledHiDPIOutput(vboxGlobal().managedVMUuid())) 1385 { 1386 const double dBackingScaleFactor = darwinBackingScaleFactor(machineWindow()); 1387 if (dBackingScaleFactor > 1.0) 1388 size = QSize(size.width() / dBackingScaleFactor, size.height() / dBackingScaleFactor); 1389 } 1390 #endif /* Q_WS_MAC */ 1391 1392 /* Return result: */ 1393 return size; 1394 } 1395 1396 QSize UIMachineView::scaledBackward(QSize size) const 1397 { 1398 #ifdef Q_WS_MAC 1399 /* Take the backing-scale-factor into account: */ 1400 if (gEDataManager->useUnscaledHiDPIOutput(vboxGlobal().managedVMUuid())) 1401 { 1402 const double dBackingScaleFactor = darwinBackingScaleFactor(machineWindow()); 1403 if (dBackingScaleFactor > 1.0) 1404 size = QSize(size.width() * dBackingScaleFactor, size.height() * dBackingScaleFactor); 1405 } 1406 #endif /* Q_WS_MAC */ 1407 1408 /* Take the scale-factor into account: */ 1409 const double dScaleFactor = gEDataManager->scaleFactor(vboxGlobal().managedVMUuid()); 1410 if (dScaleFactor != 1.0) 1411 size = QSize(size.width() / dScaleFactor, size.height() / dScaleFactor); 1412 1413 /* Return result: */ 1414 return size; 1415 } 1416 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.h
r53892 r53912 256 256 #endif 257 257 258 /** Scales passed size forward. */ 259 QSize scaledForward(QSize size) const; 260 /** Scales passed size backward. */ 261 QSize scaledBackward(QSize size) const; 262 258 263 /* Protected members: */ 259 264 UIMachineWindow *m_pMachineWindow; -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineViewFullscreen.cpp
r53909 r53912 38 38 # include "UIFrameBuffer.h" 39 39 # include "UIExtraDataManager.h" 40 # ifdef Q_WS_MAC41 # include "VBoxUtils-darwin.h"42 # endif /* Q_WS_MAC */43 40 44 41 #endif /* !VBOX_WITH_PRECOMPILED_HEADERS */ … … 152 149 /* Acquire frame-buffer size: */ 153 150 QSize frameBufferSize(frameBuffer()->width(), frameBuffer()->height()); 154 155 /* Take the scale-factor into account: */ 156 const double dScaleFactor = gEDataManager->scaleFactor(vboxGlobal().managedVMUuid()); 157 if (dScaleFactor != 1.0) 158 frameBufferSize = QSize(frameBufferSize.width() * dScaleFactor, frameBufferSize.height() * dScaleFactor); 159 160 #ifdef Q_WS_MAC 161 /* Take the backing-scale-factor into account: */ 162 if (gEDataManager->useUnscaledHiDPIOutput(vboxGlobal().managedVMUuid())) 163 { 164 const double dBackingScaleFactor = darwinBackingScaleFactor(machineWindow()); 165 if (dBackingScaleFactor > 1.0) 166 frameBufferSize = QSize(frameBufferSize.width() / dBackingScaleFactor, frameBufferSize.height() / dBackingScaleFactor); 167 } 168 #endif /* Q_WS_MAC */ 169 151 /* Take the scale-factor(s) into account: */ 152 frameBufferSize = scaledForward(frameBufferSize); 170 153 /* Check if we should adjust guest-screen to new size: */ 171 154 if (frameBuffer()->isAutoEnabled() || -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineViewNormal.cpp
r53909 r53912 37 37 # include "UIExtraDataManager.h" 38 38 # include "UIFrameBuffer.h" 39 # ifdef Q_WS_MAC40 # include "VBoxUtils-darwin.h"41 # endif /* Q_WS_MAC */42 39 43 40 #endif /* !VBOX_WITH_PRECOMPILED_HEADERS */ … … 175 172 /* Acquire frame-buffer size: */ 176 173 QSize frameBufferSize(frameBuffer()->width(), frameBuffer()->height()); 177 178 /* Take the scale-factor into account: */ 179 const double dScaleFactor = gEDataManager->scaleFactor(vboxGlobal().managedVMUuid()); 180 if (dScaleFactor != 1.0) 181 frameBufferSize = QSize(frameBufferSize.width() * dScaleFactor, frameBufferSize.height() * dScaleFactor); 182 183 #ifdef Q_WS_MAC 184 /* Take the backing-scale-factor into account: */ 185 if (gEDataManager->useUnscaledHiDPIOutput(vboxGlobal().managedVMUuid())) 186 { 187 const double dBackingScaleFactor = darwinBackingScaleFactor(machineWindow()); 188 if (dBackingScaleFactor > 1.0) 189 frameBufferSize = QSize(frameBufferSize.width() / dBackingScaleFactor, frameBufferSize.height() / dBackingScaleFactor); 190 } 191 #endif /* Q_WS_MAC */ 192 174 /* Take the scale-factor(s) into account: */ 175 frameBufferSize = scaledForward(frameBufferSize); 193 176 /* Check if we should adjust guest-screen to new size: */ 194 177 if (frameBufferSize != centralWidgetSize) -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineViewSeamless.cpp
r53909 r53912 37 37 # include "UIFrameBuffer.h" 38 38 # include "UIExtraDataManager.h" 39 # ifdef Q_WS_MAC40 # include "VBoxUtils-darwin.h"41 # endif /* Q_WS_MAC */42 39 43 40 /* COM includes: */ … … 169 166 /* Acquire frame-buffer size: */ 170 167 QSize frameBufferSize(frameBuffer()->width(), frameBuffer()->height()); 171 172 /* Take the scale-factor into account: */ 173 const double dScaleFactor = gEDataManager->scaleFactor(vboxGlobal().managedVMUuid()); 174 if (dScaleFactor != 1.0) 175 frameBufferSize = QSize(frameBufferSize.width() * dScaleFactor, frameBufferSize.height() * dScaleFactor); 176 177 #ifdef Q_WS_MAC 178 /* Take the backing-scale-factor into account: */ 179 if (gEDataManager->useUnscaledHiDPIOutput(vboxGlobal().managedVMUuid())) 180 { 181 const double dBackingScaleFactor = darwinBackingScaleFactor(machineWindow()); 182 if (dBackingScaleFactor > 1.0) 183 frameBufferSize = QSize(frameBufferSize.width() / dBackingScaleFactor, frameBufferSize.height() / dBackingScaleFactor); 184 } 185 #endif /* Q_WS_MAC */ 186 168 /* Take the scale-factor(s) into account: */ 169 frameBufferSize = scaledForward(frameBufferSize); 187 170 /* Check if we should adjust guest-screen to new size: */ 188 171 if (frameBuffer()->isAutoEnabled() ||
Note:
See TracChangeset
for help on using the changeset viewer.