Changeset 53909 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Jan 22, 2015 10:51:03 AM (10 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
r53892 r53909 62 62 #endif /* !VBOX_WITH_PRECOMPILED_HEADERS */ 63 63 64 65 64 /* Other VBox includes: */ 66 65 #include <iprt/asm.h> … … 193 192 * the available size for the guest display. We assume here that centralWidget() 194 193 * contains this view only and gives it all available space: */ 195 QSize newSize(toSize.isValid() ? toSize : machineWindow()->centralWidget()->size());196 AssertMsg( newSize.isValid(), ("Size should be valid!\n"));194 QSize size(toSize.isValid() ? toSize : machineWindow()->centralWidget()->size()); 195 AssertMsg(size.isValid(), ("Size should be valid!\n")); 197 196 198 197 #ifdef Q_WS_MAC … … 202 201 const double dBackingScaleFactor = darwinBackingScaleFactor(machineWindow()); 203 202 if (dBackingScaleFactor > 1.0) 204 newSize *= dBackingScaleFactor;203 size = QSize(size.width() * dBackingScaleFactor, size.height() * dBackingScaleFactor); 205 204 } 206 205 #endif /* Q_WS_MAC */ 207 206 208 207 /* Take the scale-factor into account: */ 209 newSize /= gEDataManager->scaleFactor(vboxGlobal().managedVMUuid()); 208 const double dScaleFactor = gEDataManager->scaleFactor(vboxGlobal().managedVMUuid()); 209 if (dScaleFactor != 1.0) 210 size = QSize(size.width() / dScaleFactor, size.height() / dScaleFactor); 210 211 211 212 /* Expand current limitations: */ 212 setMaxGuestSize( newSize);213 setMaxGuestSize(size); 213 214 214 215 /* Send new size-hint to the guest: */ 215 216 LogRel(("UIMachineView::sltPerformGuestResize: " 216 217 "Sending guest size-hint to screen %d as %dx%d\n", 217 (int)screenId(), newSize.width(), newSize.height()));218 (int)screenId(), size.width(), size.height())); 218 219 display().SetVideoModeHint(screenId(), 219 220 uisession()->isScreenVisible(screenId()), 220 false, 0, 0, newSize.width(), newSize.height(), 0);221 false, 0, 0, size.width(), size.height(), 0); 221 222 222 223 /* And track whether we have a "normal" or "fullscreen"/"seamless" size-hint sent: */ … … 324 325 if (dBackingScaleFactor > 1.0) 325 326 { 326 rect.moveTo(rect.topLeft() / dBackingScaleFactor - QPoint(1, 1)); 327 rect.setSize(rect.size() / dBackingScaleFactor + QSize(2, 2)); 327 rect.moveTo(rect.x() / dBackingScaleFactor - 1, 328 rect.y() / dBackingScaleFactor - 1); 329 rect.setSize(QSize(rect.width() / dBackingScaleFactor + 2, 330 rect.height() / dBackingScaleFactor + 2)); 328 331 } 329 332 } … … 741 744 QSize size(m_pFrameBuffer->width(), m_pFrameBuffer->height()); 742 745 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 743 751 #ifdef Q_WS_MAC 744 752 /* Take the backing-scale-factor into account: */ … … 747 755 const double dBackingScaleFactor = darwinBackingScaleFactor(machineWindow()); 748 756 if (dBackingScaleFactor > 1.0) 749 size /= dBackingScaleFactor;757 size = QSize(size.width() / dBackingScaleFactor, size.height() / dBackingScaleFactor); 750 758 } 751 759 #endif /* Q_WS_MAC */ 752 753 /* Take the scale-factor into account: */754 size *= gEDataManager->scaleFactor(vboxGlobal().managedVMUuid());755 760 756 761 #ifdef VBOX_WITH_DEBUGGER_GUI … … 834 839 size = QSize(800, 600); 835 840 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 836 846 #ifdef Q_WS_MAC 837 847 /* Take the backing-scale-factor into account: */ … … 840 850 const double dBackingScaleFactor = darwinBackingScaleFactor(machineWindow()); 841 851 if (dBackingScaleFactor > 1.0) 842 size /= dBackingScaleFactor;852 size = QSize(size.width() / dBackingScaleFactor, size.height() / dBackingScaleFactor); 843 853 } 844 854 #endif /* Q_WS_MAC */ 845 846 /* Take the scale-factor into account: */847 size *= gEDataManager->scaleFactor(vboxGlobal().managedVMUuid());848 855 849 856 /* Return size: */ … … 970 977 QSize v = QSize(frameBuffer()->width(), frameBuffer()->height()); 971 978 979 /* Take the scale-factor into account: */ 980 const double dScaleFactor = gEDataManager->scaleFactor(vboxGlobal().managedVMUuid()); 981 if (dScaleFactor != 1.0) 982 v = QSize(v.width() * dScaleFactor, v.height() * dScaleFactor); 983 972 984 #ifdef Q_WS_MAC 973 985 /* Take the backing-scale-factor into account: */ … … 976 988 const double dBackingScaleFactor = darwinBackingScaleFactor(machineWindow()); 977 989 if (dBackingScaleFactor > 1.0) 978 v /= dBackingScaleFactor;990 v = QSize(v.width() / dBackingScaleFactor, v.height() / dBackingScaleFactor); 979 991 } 980 992 #endif /* Q_WS_MAC */ 981 982 /* Take the scale-factor into account: */983 v *= gEDataManager->scaleFactor(vboxGlobal().managedVMUuid());984 993 985 994 /* No scroll bars needed: */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineViewFullscreen.cpp
r53389 r53909 20 20 #else /* !VBOX_WITH_PRECOMPILED_HEADERS */ 21 21 22 /* Global includes*/22 /* Qt includes: */ 23 23 # include <QApplication> 24 24 # include <QDesktopWidget> … … 27 27 # ifdef Q_WS_MAC 28 28 # include <QMenuBar> 29 # endif 29 # endif /* Q_WS_MAC */ 30 30 31 /* Local includes*/31 /* GUI includes: */ 32 32 # include "VBoxGlobal.h" 33 33 # include "UISession.h" … … 38 38 # include "UIFrameBuffer.h" 39 39 # include "UIExtraDataManager.h" 40 # ifdef Q_WS_MAC 41 # include "VBoxUtils-darwin.h" 42 # endif /* Q_WS_MAC */ 40 43 41 44 #endif /* !VBOX_WITH_PRECOMPILED_HEADERS */ … … 43 46 #ifdef Q_WS_X11 44 47 # include <limits.h> 45 #endif 48 #endif /* Q_WS_X11 */ 46 49 47 50 … … 149 152 /* Acquire frame-buffer size: */ 150 153 QSize frameBufferSize(frameBuffer()->width(), frameBuffer()->height()); 154 151 155 /* Take the scale-factor into account: */ 152 frameBufferSize *= gEDataManager->scaleFactor(vboxGlobal().managedVMUuid()); 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 153 170 /* Check if we should adjust guest-screen to new size: */ 154 171 if (frameBuffer()->isAutoEnabled() || -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineViewNormal.cpp
r53389 r53909 20 20 #else /* !VBOX_WITH_PRECOMPILED_HEADERS */ 21 21 22 /* Global includes*/22 /* Qt includes: */ 23 23 # include <QApplication> 24 24 # include <QDesktopWidget> … … 28 28 # include <QTimer> 29 29 30 /* Local includes*/30 /* GUI includes: */ 31 31 # include "VBoxGlobal.h" 32 32 # include "UISession.h" … … 37 37 # include "UIExtraDataManager.h" 38 38 # include "UIFrameBuffer.h" 39 # ifdef Q_WS_MAC 40 # include "VBoxUtils-darwin.h" 41 # endif /* Q_WS_MAC */ 39 42 40 43 #endif /* !VBOX_WITH_PRECOMPILED_HEADERS */ … … 172 175 /* Acquire frame-buffer size: */ 173 176 QSize frameBufferSize(frameBuffer()->width(), frameBuffer()->height()); 177 174 178 /* Take the scale-factor into account: */ 175 frameBufferSize *= gEDataManager->scaleFactor(vboxGlobal().managedVMUuid()); 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 176 193 /* Check if we should adjust guest-screen to new size: */ 177 194 if (frameBufferSize != centralWidgetSize) -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineViewSeamless.cpp
r53389 r53909 37 37 # include "UIFrameBuffer.h" 38 38 # include "UIExtraDataManager.h" 39 # ifdef Q_WS_MAC 40 # include "VBoxUtils-darwin.h" 41 # endif /* Q_WS_MAC */ 39 42 40 43 /* COM includes: */ … … 166 169 /* Acquire frame-buffer size: */ 167 170 QSize frameBufferSize(frameBuffer()->width(), frameBuffer()->height()); 171 168 172 /* Take the scale-factor into account: */ 169 frameBufferSize *= gEDataManager->scaleFactor(vboxGlobal().managedVMUuid()); 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 170 187 /* Check if we should adjust guest-screen to new size: */ 171 188 if (frameBuffer()->isAutoEnabled() ||
Note:
See TracChangeset
for help on using the changeset viewer.