Changeset 97978 in vbox
- Timestamp:
- Jan 4, 2023 2:24:31 PM (2 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/runtime
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp
r97977 r97978 1266 1266 } 1267 1267 1268 QSize UIMachineView::requestedGuestScreenSizeHint() const 1269 { 1270 /* Acquire last guest-screen size-hint set, if any: */ 1271 BOOL fEnabled, fChangeOrigin; 1272 LONG iOriginX, iOriginY; 1273 ULONG uWidth, uHeight, uBitsPerPixel; 1274 display().GetVideoModeHint(screenId(), fEnabled, fChangeOrigin, 1275 iOriginX, iOriginY, uWidth, uHeight, uBitsPerPixel); 1276 1277 /* Acquire effective frame-buffer size otherwise: */ 1278 if (uWidth == 0 || uHeight == 0) 1279 { 1280 uWidth = frameBuffer()->width(); 1281 uHeight = frameBuffer()->height(); 1282 } 1283 1284 /* Return result: */ 1285 return QSize((int)uWidth, (int)uHeight); 1286 } 1287 1268 1288 bool UIMachineView::guestScreenVisibilityStatus() const 1269 1289 { -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.h
r97977 r97978 240 240 void setStoredGuestScreenSizeHint(const QSize &sizeHint); 241 241 242 /** Retrieves the sent guest-screen size-hint from display or frame-buffer. */ 243 QSize requestedGuestScreenSizeHint() const; 244 242 245 /** Retrieves the last guest-screen visibility status from extra-data. */ 243 246 bool guestScreenVisibilityStatus() const; -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineViewFullscreen.cpp
r97976 r97978 74 74 /* Send guest-resize hint only if top window resizing to required dimension: */ 75 75 QResizeEvent *pResizeEvent = static_cast<QResizeEvent*>(pEvent); 76 if (pResizeEvent->size() != workingArea().size())76 if (pResizeEvent->size() != calculateMaxGuestSize()) 77 77 break; 78 78 … … 150 150 if (!fAdjust) 151 151 { 152 /* Acquire frame-buffer size: */153 QSize frameBufferSize(frameBuffer()->width(), frameBuffer()->height());152 /* Acquire requested guest-screen size-hint or at least actual frame-buffer size: */ 153 QSize guestScreenSizeHint = requestedGuestScreenSizeHint(); 154 154 /* Take the scale-factor(s) into account: */ 155 frameBufferSize = scaledForward(frameBufferSize);156 157 /* Acquire working-areasize: */158 const QSize workingAreaSize = workingArea().size();159 160 if ( frameBufferSize != workingAreaSize)155 guestScreenSizeHint = scaledForward(guestScreenSizeHint); 156 157 /* Calculate maximum possible guest screen size: */ 158 const QSize maximumGuestScreenSize = calculateMaxGuestSize(); 159 160 if (guestScreenSizeHint != maximumGuestScreenSize) 161 161 { 162 162 LogRel2(("GUI: UIMachineViewFullscreen::adjustGuestScreenSize: Guest-screen is of another size than necessary, adjustment is required.\n")); … … 197 197 { 198 198 frameBuffer()->setAutoEnabled(false); 199 sltPerformGuestResize( workingArea().size());199 sltPerformGuestResize(calculateMaxGuestSize()); 200 200 /* And remember the size to know what we are resizing out of when we exit: */ 201 uisession()->setLastFullScreenSize(screenId(), scaledForward(scaledBackward( workingArea().size())));201 uisession()->setLastFullScreenSize(screenId(), scaledForward(scaledBackward(calculateMaxGuestSize()))); 202 202 } 203 203 } -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineViewNormal.cpp
r97977 r97978 181 181 LogRel(("GUI: UIMachineViewNormal::adjustGuestScreenSize: Adjust guest-screen size if necessary\n")); 182 182 183 /* Get last monitor size set, if any: */ 184 BOOL fEnabled, fChangeOrigin; 185 LONG iOriginX, iOriginY; 186 ULONG uWidth, uHeight, uBitsPerPixel; 187 display().GetVideoModeHint(screenId(), fEnabled, fChangeOrigin, 188 iOriginX, iOriginY, uWidth, uHeight, uBitsPerPixel); 189 190 /* Acquire effective frame-buffer size otherwise: */ 191 if (uWidth == 0 || uHeight == 0) 192 { 193 uWidth = frameBuffer()->width(); 194 uHeight = frameBuffer()->height(); 195 } 196 197 /* Compose frame-buffer size: */ 198 QSize frameBufferSize(uWidth, uHeight); 183 /* Acquire requested guest-screen size-hint or at least actual frame-buffer size: */ 184 QSize guestScreenSizeHint = requestedGuestScreenSizeHint(); 199 185 /* Take the scale-factor(s) into account: */ 200 frameBufferSize = scaledForward(frameBufferSize); 201 202 /* Adjust guest-screen size if the last size hint is too big for the screen: */ 203 const QSize maximumGuestSize = calculateMaxGuestSize(); 204 if ( maximumGuestSize.width() < frameBufferSize.width() 205 || maximumGuestSize.height() < frameBufferSize.height()) 186 guestScreenSizeHint = scaledForward(guestScreenSizeHint); 187 188 /* Calculate maximum possible guest screen size: */ 189 const QSize maximumGuestScreenSize = calculateMaxGuestSize(); 190 191 /* Adjust guest-screen size if the requested one is too big for the screen: */ 192 if ( guestScreenSizeHint.width() > maximumGuestScreenSize.width() 193 || guestScreenSizeHint.height() > maximumGuestScreenSize.height()) 206 194 sltPerformGuestResize(machineWindow()->centralWidget()->size()); 207 195 } -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineViewSeamless.cpp
r97976 r97978 85 85 /* Send guest-resize hint only if top window resizing to required dimension: */ 86 86 QResizeEvent *pResizeEvent = static_cast<QResizeEvent*>(pEvent); 87 if (pResizeEvent->size() != workingArea().size())87 if (pResizeEvent->size() != calculateMaxGuestSize()) 88 88 break; 89 89 … … 163 163 if (!fAdjust) 164 164 { 165 /* Acquire frame-buffer size: */166 QSize frameBufferSize(frameBuffer()->width(), frameBuffer()->height());165 /* Acquire requested guest-screen size-hint or at least actual frame-buffer size: */ 166 QSize guestScreenSizeHint = requestedGuestScreenSizeHint(); 167 167 /* Take the scale-factor(s) into account: */ 168 frameBufferSize = scaledForward(frameBufferSize);169 170 /* Acquire working-areasize: */171 const QSize workingAreaSize = workingArea().size();172 173 if ( frameBufferSize != workingAreaSize)168 guestScreenSizeHint = scaledForward(guestScreenSizeHint); 169 170 /* Calculate maximum possible guest screen size: */ 171 const QSize maximumGuestScreenSize = calculateMaxGuestSize(); 172 173 if (guestScreenSizeHint != maximumGuestScreenSize) 174 174 { 175 175 LogRel2(("GUI: UIMachineViewSeamless::adjustGuestScreenSize: Guest-screen is of another size than necessary, adjustment is required.\n")); … … 201 201 { 202 202 frameBuffer()->setAutoEnabled(false); 203 sltPerformGuestResize( workingArea().size());203 sltPerformGuestResize(calculateMaxGuestSize()); 204 204 /* And remember the size to know what we are resizing out of when we exit: */ 205 uisession()->setLastFullScreenSize(screenId(), scaledForward(scaledBackward( workingArea().size())));205 uisession()->setLastFullScreenSize(screenId(), scaledForward(scaledBackward(calculateMaxGuestSize()))); 206 206 } 207 207 }
Note:
See TracChangeset
for help on using the changeset viewer.