Changeset 98556 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Feb 14, 2023 11:18:01 AM (2 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/runtime
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.cpp
r98548 r98556 459 459 { 460 460 return uisession()->acquireScreenShot(uScreenId, uWidth, uHeight, enmFormat, pBits); 461 } 462 463 bool UIMachine::notifyScaleFactorChange(ulong uScreenId, ulong uScaleFactorWMultiplied, ulong uScaleFactorHMultiplied) 464 { 465 return uisession()->notifyScaleFactorChange(uScreenId, uScaleFactorWMultiplied, uScaleFactorHMultiplied); 466 } 467 468 bool UIMachine::notifyHiDPIOutputPolicyChange(bool fUnscaledHiDPI) 469 { 470 return uisession()->notifyHiDPIOutputPolicyChange(fUnscaledHiDPI); 471 } 472 473 bool UIMachine::setSeamlessMode(bool fEnabled) 474 { 475 return uisession()->setSeamlessMode(fEnabled); 461 476 } 462 477 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.h
r98548 r98556 291 291 /** Acquires screen-shot for guest-screen with passed uScreenId. */ 292 292 bool acquireScreenShot(ulong uScreenId, ulong uWidth, ulong uHeight, KBitmapFormat enmFormat, uchar *pBits); 293 /** Notifies guest-screen with passed uScreenId about scale-factor change. */ 294 bool notifyScaleFactorChange(ulong uScreenId, ulong uScaleFactorWMultiplied, ulong uScaleFactorHMultiplied); 295 /** Notifies display about unscaled HiDPI policy change. */ 296 bool notifyHiDPIOutputPolicyChange(bool fUnscaledHiDPI); 297 /** Defines whether seamless mode is enabled for display. */ 298 bool setSeamlessMode(bool fEnabled); 293 299 /** @} */ 294 300 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp
r98555 r98556 249 249 dScaleFactorFor3D *= frameBuffer()->devicePixelRatioActual(); 250 250 #endif /* VBOX_WS_WIN || VBOX_WS_X11 */ 251 display().NotifyScaleFactorChange(m_uScreenId,252 (uint32_t)(dScaleFactorFor3D * VBOX_OGL_SCALE_FACTOR_MULTIPLIER),253 (uint32_t)(dScaleFactorFor3D * VBOX_OGL_SCALE_FACTOR_MULTIPLIER));254 display().NotifyHiDPIOutputPolicyChange(fUseUnscaledHiDPIOutput);251 uimachine()->notifyScaleFactorChange(m_uScreenId, 252 (uint32_t)(dScaleFactorFor3D * VBOX_OGL_SCALE_FACTOR_MULTIPLIER), 253 (uint32_t)(dScaleFactorFor3D * VBOX_OGL_SCALE_FACTOR_MULTIPLIER)); 254 uimachine()->notifyHiDPIOutputPolicyChange(fUseUnscaledHiDPIOutput); 255 255 } 256 256 … … 1002 1002 dScaleFactorFor3D *= frameBuffer()->devicePixelRatioActual(); 1003 1003 #endif /* VBOX_WS_WIN || VBOX_WS_X11 */ 1004 display().NotifyScaleFactorChange(m_uScreenId,1005 (uint32_t)(dScaleFactorFor3D * VBOX_OGL_SCALE_FACTOR_MULTIPLIER),1006 (uint32_t)(dScaleFactorFor3D * VBOX_OGL_SCALE_FACTOR_MULTIPLIER));1007 display().NotifyHiDPIOutputPolicyChange(fUseUnscaledHiDPIOutput);1004 uimachine()->notifyScaleFactorChange(m_uScreenId, 1005 (uint32_t)(dScaleFactorFor3D * VBOX_OGL_SCALE_FACTOR_MULTIPLIER), 1006 (uint32_t)(dScaleFactorFor3D * VBOX_OGL_SCALE_FACTOR_MULTIPLIER)); 1007 uimachine()->notifyHiDPIOutputPolicyChange(fUseUnscaledHiDPIOutput); 1008 1008 } 1009 1009 … … 1234 1234 dScaleFactorFor3D *= dDevicePixelRatioActual; 1235 1235 #endif /* VBOX_WS_WIN || VBOX_WS_X11 */ 1236 display().NotifyScaleFactorChange(m_uScreenId,1237 (uint32_t)(dScaleFactorFor3D * VBOX_OGL_SCALE_FACTOR_MULTIPLIER),1238 (uint32_t)(dScaleFactorFor3D * VBOX_OGL_SCALE_FACTOR_MULTIPLIER));1239 display().NotifyHiDPIOutputPolicyChange(fUseUnscaledHiDPIOutput);1236 uimachine()->notifyScaleFactorChange(m_uScreenId, 1237 (uint32_t)(dScaleFactorFor3D * VBOX_OGL_SCALE_FACTOR_MULTIPLIER), 1238 (uint32_t)(dScaleFactorFor3D * VBOX_OGL_SCALE_FACTOR_MULTIPLIER)); 1239 uimachine()->notifyHiDPIOutputPolicyChange(fUseUnscaledHiDPIOutput); 1240 1240 } 1241 1241 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp
r98548 r98556 483 483 UINotificationMessage::cannotAcquireDisplayParameter(comDisplay); 484 484 } 485 return fSuccess; 486 } 487 488 bool UISession::notifyScaleFactorChange(ulong uScreenId, ulong uScaleFactorWMultiplied, ulong uScaleFactorHMultiplied) 489 { 490 CDisplay comDisplay = display(); 491 comDisplay.NotifyScaleFactorChange(uScreenId, uScaleFactorWMultiplied, uScaleFactorHMultiplied); 492 const bool fSuccess = comDisplay.isOk(); 493 if (!fSuccess) 494 UINotificationMessage::cannotChangeDisplayParameter(comDisplay); 495 return fSuccess; 496 } 497 498 bool UISession::notifyHiDPIOutputPolicyChange(bool fUnscaledHiDPI) 499 { 500 CDisplay comDisplay = display(); 501 comDisplay.NotifyHiDPIOutputPolicyChange(fUnscaledHiDPI); 502 const bool fSuccess = comDisplay.isOk(); 503 if (!fSuccess) 504 UINotificationMessage::cannotChangeDisplayParameter(comDisplay); 505 return fSuccess; 506 } 507 508 bool UISession::setSeamlessMode(bool fEnabled) 509 { 510 CDisplay comDisplay = display(); 511 comDisplay.SetSeamlessMode(fEnabled); 512 const bool fSuccess = comDisplay.isOk(); 513 if (!fSuccess) 514 UINotificationMessage::cannotChangeDisplayParameter(comDisplay); 485 515 return fSuccess; 486 516 } -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h
r98548 r98556 309 309 /** Acquires screen-shot for guest-screen with passed uScreenId. */ 310 310 bool acquireScreenShot(ulong uScreenId, ulong uWidth, ulong uHeight, KBitmapFormat enmFormat, uchar *pBits); 311 /** Notifies guest-screen with passed uScreenId about scale-factor change. */ 312 bool notifyScaleFactorChange(ulong uScreenId, ulong uScaleFactorWMultiplied, ulong uScaleFactorHMultiplied); 313 /** Notifies display about unscaled HiDPI policy change. */ 314 bool notifyHiDPIOutputPolicyChange(bool fUnscaledHiDPI); 315 /** Defines whether seamless mode is enabled for display. */ 316 bool setSeamlessMode(bool fEnabled); 311 317 /** @} */ 312 318 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineLogicNormal.cpp
r98451 r98556 51 51 /* COM includes: */ 52 52 #include "CConsole.h" 53 #include "CDisplay.h"54 53 #include "CGraphicsAdapter.h" 55 54 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineViewScale.cpp
r98547 r98556 41 41 42 42 /* COM includes: */ 43 #include "CDisplay.h"44 43 #include "CGraphicsAdapter.h" 45 44 … … 85 84 } 86 85 #endif /* VBOX_WS_WIN || VBOX_WS_X11 */ 87 display().NotifyScaleFactorChange(m_uScreenId,88 (uint32_t)(xScaleFactor * VBOX_OGL_SCALE_FACTOR_MULTIPLIER),89 (uint32_t)(yScaleFactor * VBOX_OGL_SCALE_FACTOR_MULTIPLIER));86 uimachine()->notifyScaleFactorChange(m_uScreenId, 87 (uint32_t)(xScaleFactor * VBOX_OGL_SCALE_FACTOR_MULTIPLIER), 88 (uint32_t)(yScaleFactor * VBOX_OGL_SCALE_FACTOR_MULTIPLIER)); 90 89 } 91 90 } … … 144 143 } 145 144 #endif /* VBOX_WS_WIN || VBOX_WS_X11 */ 146 display().NotifyScaleFactorChange(m_uScreenId,147 (uint32_t)(xScaleFactor * VBOX_OGL_SCALE_FACTOR_MULTIPLIER),148 (uint32_t)(yScaleFactor * VBOX_OGL_SCALE_FACTOR_MULTIPLIER));145 uimachine()->notifyScaleFactorChange(m_uScreenId, 146 (uint32_t)(xScaleFactor * VBOX_OGL_SCALE_FACTOR_MULTIPLIER), 147 (uint32_t)(yScaleFactor * VBOX_OGL_SCALE_FACTOR_MULTIPLIER)); 149 148 } 150 149 } … … 154 153 /* Propagate unscaled-hidpi-output feature to 3D service if necessary: */ 155 154 if (machine().GetGraphicsAdapter().GetAccelerate3DEnabled()) 156 display().NotifyHiDPIOutputPolicyChange(fUseUnscaledHiDPIOutput);155 uimachine()->notifyHiDPIOutputPolicyChange(fUseUnscaledHiDPIOutput); 157 156 158 157 /* Perform frame-buffer rescaling: */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineViewSeamless.cpp
r98432 r98556 46 46 /* COM includes: */ 47 47 #include "CConsole.h" 48 #include "CDisplay.h"49 48 50 49 /* Other VBox includes: */ … … 136 135 { 137 136 /* Set seamless feature flag to the guest: */ 138 display().SetSeamlessMode(true);137 uimachine()->setSeamlessMode(true); 139 138 } 140 139 … … 143 142 /* Reset seamless feature flag if possible: */ 144 143 if (uimachine()->isRunning()) 145 display().SetSeamlessMode(false);144 uimachine()->setSeamlessMode(false); 146 145 } 147 146
Note:
See TracChangeset
for help on using the changeset viewer.