Changeset 99135 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Mar 23, 2023 10:44:39 AM (21 months ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/runtime
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.cpp
r99134 r99135 459 459 { 460 460 /* Make sure index feats the bounds: */ 461 AssertReturn(uScreenId < (ulong)m_ monitorVisibilityVectorHostDesires.size(), false);461 AssertReturn(uScreenId < (ulong)m_guestScreenVisibilityVectorHostDesires.size(), false); 462 462 463 463 /* Return 'actual' (host-desire) visibility status: */ 464 return m_ monitorVisibilityVectorHostDesires.value((int)uScreenId);464 return m_guestScreenVisibilityVectorHostDesires.value((int)uScreenId); 465 465 } 466 466 … … 468 468 { 469 469 /* Make sure index feats the bounds: */ 470 AssertReturnVoid(uScreenId < (ulong)m_ monitorVisibilityVectorHostDesires.size());470 AssertReturnVoid(uScreenId < (ulong)m_guestScreenVisibilityVectorHostDesires.size()); 471 471 472 472 /* Remember 'actual' (host-desire) visibility status: */ 473 m_ monitorVisibilityVectorHostDesires[(int)uScreenId] = fIsMonitorVisible;473 m_guestScreenVisibilityVectorHostDesires[(int)uScreenId] = fIsMonitorVisible; 474 474 475 475 /* And remember the request in extra data for guests with VMSVGA: */ … … 481 481 { 482 482 /* Make sure index feats the bounds: */ 483 AssertReturn(uScreenId < (ulong)m_ monitorVisibilityVector.size(), false);483 AssertReturn(uScreenId < (ulong)m_guestScreenVisibilityVector.size(), false); 484 484 485 485 /* Return 'actual' visibility status: */ 486 return m_ monitorVisibilityVector.value((int)uScreenId);486 return m_guestScreenVisibilityVector.value((int)uScreenId); 487 487 } 488 488 … … 490 490 { 491 491 /* Make sure index feats the bounds: */ 492 AssertReturnVoid(uScreenId < (ulong)m_ monitorVisibilityVector.size());492 AssertReturnVoid(uScreenId < (ulong)m_guestScreenVisibilityVector.size()); 493 493 494 494 /* Remember 'actual' visibility status: */ 495 m_ monitorVisibilityVector[(int)uScreenId] = fIsMonitorVisible;495 m_guestScreenVisibilityVector[(int)uScreenId] = fIsMonitorVisible; 496 496 /* Remember 'desired' visibility status: */ 497 497 // See note in UIMachineView::sltHandleNotifyChange() regarding the graphics controller check. */ … … 508 508 { 509 509 int cCountOfVisibleWindows = 0; 510 for (int i = 0; i < m_ monitorVisibilityVector.size(); ++i)511 if (m_ monitorVisibilityVector[i])510 for (int i = 0; i < m_guestScreenVisibilityVector.size(); ++i) 511 if (m_guestScreenVisibilityVector[i]) 512 512 ++cCountOfVisibleWindows; 513 513 return cCountOfVisibleWindows; … … 517 517 { 518 518 QList<int> visibleWindows; 519 for (int i = 0; i < m_ monitorVisibilityVector.size(); ++i)520 if (m_ monitorVisibilityVector.at(i))519 for (int i = 0; i < m_guestScreenVisibilityVector.size(); ++i) 520 if (m_guestScreenVisibilityVector.at(i)) 521 521 visibleWindows.push_back(i); 522 522 return visibleWindows; … … 1121 1121 1122 1122 /* Remember new visual state: */ 1123 m_ visualState = visualState;1123 m_enmVisualState = visualState; 1124 1124 1125 1125 /* Save requested visual state: */ 1126 gEDataManager->setRequestedVisualState(m_ visualState, uiCommon().managedVMUuid());1126 gEDataManager->setRequestedVisualState(m_enmVisualState, uiCommon().managedVMUuid()); 1127 1127 } 1128 1128 else … … 1135 1135 if (!m_pMachineLogic) 1136 1136 { 1137 /* Reset initial visual state 1138 m_ initialVisualState = UIVisualStateType_Normal;1137 /* Reset initial visual state to normal: */ 1138 m_enmInitialVisualState = UIVisualStateType_Normal; 1139 1139 /* Enter initial visual state again: */ 1140 1140 enterInitialVisualState(); … … 1411 1411 , m_fInitialized(false) 1412 1412 , m_pSession(0) 1413 , m_ allowedVisualStates(UIVisualStateType_Invalid)1414 , m_ initialVisualState(UIVisualStateType_Normal)1415 , m_ visualState(UIVisualStateType_Invalid)1413 , m_enmAllowedVisualStates(UIVisualStateType_Invalid) 1414 , m_enmInitialVisualState(UIVisualStateType_Normal) 1415 , m_enmVisualState(UIVisualStateType_Invalid) 1416 1416 , m_enmRequestedVisualState(UIVisualStateType_Invalid) 1417 1417 , m_pMachineLogic(0) … … 1679 1679 #endif /* !VBOX_WS_MAC */ 1680 1680 1681 /* Accquire monitorcount: */1681 /* Accquire guest-screen count: */ 1682 1682 ulong cMonitorCount = 0; 1683 1683 acquireMonitorCount(cMonitorCount); 1684 1684 1685 1685 /* Prepare initial screen visibility status: */ 1686 m_monitorVisibilityVector.resize(cMonitorCount); 1687 m_monitorVisibilityVector.fill(false); 1688 m_monitorVisibilityVector[0] = true; 1686 m_guestScreenVisibilityVector.fill(false, cMonitorCount); 1687 m_guestScreenVisibilityVector[0] = true; 1689 1688 1690 1689 /* Prepare empty last full-screen size vector: */ 1691 m_monitorLastFullScreenSizeVector.resize(cMonitorCount); 1692 m_monitorLastFullScreenSizeVector.fill(QSize(-1, -1)); 1690 m_monitorLastFullScreenSizeVector.fill(QSize(-1, -1), cMonitorCount); 1693 1691 1694 1692 /* If machine is in 'saved' state: */ … … 1696 1694 { 1697 1695 /* Update screen visibility status from saved-state: */ 1698 for (int iScreenIndex = 0; iScreenIndex < m_ monitorVisibilityVector.size(); ++iScreenIndex)1696 for (int iScreenIndex = 0; iScreenIndex < m_guestScreenVisibilityVector.size(); ++iScreenIndex) 1699 1697 { 1700 1698 long iDummy = 0; … … 1702 1700 bool fEnabled = true; 1703 1701 acquireSavedGuestScreenInfo(iScreenIndex, iDummy, iDummy, uDummy, uDummy, fEnabled); 1704 m_ monitorVisibilityVector[iScreenIndex] = fEnabled;1702 m_guestScreenVisibilityVector[iScreenIndex] = fEnabled; 1705 1703 } 1706 1704 /* And make sure at least one of them is visible (primary if others are hidden): */ 1707 1705 if (countOfVisibleWindows() < 1) 1708 m_ monitorVisibilityVector[0] = true;1706 m_guestScreenVisibilityVector[0] = true; 1709 1707 } 1710 1708 else if (uiCommon().isSeparateProcess()) 1711 1709 { 1712 1710 /* Update screen visibility status from display directly: */ 1713 for (int iScreenIndex = 0; iScreenIndex < m_ monitorVisibilityVector.size(); ++iScreenIndex)1711 for (int iScreenIndex = 0; iScreenIndex < m_guestScreenVisibilityVector.size(); ++iScreenIndex) 1714 1712 { 1715 KGuestMonitorStatus enmMonitorStatus = KGuestMonitorStatus_Disabled;1716 1713 ulong uDummy = 0; 1717 1714 long iDummy = 0; 1715 KGuestMonitorStatus enmMonitorStatus = KGuestMonitorStatus_Disabled; 1718 1716 acquireGuestScreenParameters(iScreenIndex, uDummy, uDummy, uDummy, iDummy, iDummy, enmMonitorStatus); 1719 m_ monitorVisibilityVector[iScreenIndex] = ( enmMonitorStatus == KGuestMonitorStatus_Enabled1720 || enmMonitorStatus == KGuestMonitorStatus_Blank);1717 m_guestScreenVisibilityVector[iScreenIndex] = ( enmMonitorStatus == KGuestMonitorStatus_Enabled 1718 || enmMonitorStatus == KGuestMonitorStatus_Blank); 1721 1719 } 1722 1720 /* And make sure at least one of them is visible (primary if others are hidden): */ 1723 1721 if (countOfVisibleWindows() < 1) 1724 m_ monitorVisibilityVector[0] = true;1722 m_guestScreenVisibilityVector[0] = true; 1725 1723 } 1726 1724 1727 1725 /* Prepare initial screen visibility status of host-desires (same as facts): */ 1728 m_ monitorVisibilityVectorHostDesires.resize(cMonitorCount);1729 for (int iScreenIndex = 0; iScreenIndex < m_ monitorVisibilityVector.size(); ++iScreenIndex)1730 m_ monitorVisibilityVectorHostDesires[iScreenIndex] = m_monitorVisibilityVector[iScreenIndex];1726 m_guestScreenVisibilityVectorHostDesires.resize(cMonitorCount); 1727 for (int iScreenIndex = 0; iScreenIndex < m_guestScreenVisibilityVector.size(); ++iScreenIndex) 1728 m_guestScreenVisibilityVectorHostDesires[iScreenIndex] = m_guestScreenVisibilityVector[iScreenIndex]; 1731 1729 1732 1730 /* Make sure action-pool knows guest-screen visibility status: */ 1733 for (int iScreenIndex = 0; iScreenIndex < m_ monitorVisibilityVector.size(); ++iScreenIndex)1734 actionPool()->toRuntime()->setGuestScreenVisible(iScreenIndex, m_ monitorVisibilityVector.at(iScreenIndex));1731 for (int iScreenIndex = 0; iScreenIndex < m_guestScreenVisibilityVector.size(); ++iScreenIndex) 1732 actionPool()->toRuntime()->setGuestScreenVisible(iScreenIndex, m_guestScreenVisibilityVector.at(iScreenIndex)); 1735 1733 } 1736 1734 … … 1763 1761 1764 1762 /* Load restricted visual states: */ 1765 UIVisualStateType restrictedVisualStates = gEDataManager->restrictedVisualStates(uiCommon().managedVMUuid());1763 UIVisualStateType enmRestrictedVisualStates = gEDataManager->restrictedVisualStates(uiCommon().managedVMUuid()); 1766 1764 /* Acquire allowed visual states: */ 1767 m_ allowedVisualStates = static_cast<UIVisualStateType>(UIVisualStateType_All ^ restrictedVisualStates);1765 m_enmAllowedVisualStates = static_cast<UIVisualStateType>(UIVisualStateType_All ^ enmRestrictedVisualStates); 1768 1766 1769 1767 /* Load requested visual state, it can override initial one: */ … … 1775 1773 { 1776 1774 /* Direct transition allowed to scale/fullscreen modes only: */ 1777 case UIVisualStateType_Scale: m_initialVisualState = UIVisualStateType_Scale; break; 1778 case UIVisualStateType_Fullscreen: m_initialVisualState = UIVisualStateType_Fullscreen; break; 1779 default: break; 1775 case UIVisualStateType_Scale: 1776 case UIVisualStateType_Fullscreen: 1777 m_enmInitialVisualState = m_enmRequestedVisualState; 1778 break; 1779 default: 1780 break; 1780 1781 } 1781 1782 } … … 1849 1850 void UIMachine::enterInitialVisualState() 1850 1851 { 1851 sltChangeVisualState(m_ initialVisualState);1852 sltChangeVisualState(m_enmInitialVisualState); 1852 1853 } 1853 1854 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.h
r98983 r99135 179 179 180 180 /** Returns whether requested visual @a state allowed. */ 181 bool isVisualStateAllowed(UIVisualStateType state) const { return m_ allowedVisualStates & state; }181 bool isVisualStateAllowed(UIVisualStateType state) const { return m_enmAllowedVisualStates & state; } 182 182 183 183 /** Requests async visual-state change. */ … … 942 942 943 943 /** Holds allowed visual states. */ 944 UIVisualStateType m_ allowedVisualStates;944 UIVisualStateType m_enmAllowedVisualStates; 945 945 /** Holds initial visual state. */ 946 UIVisualStateType m_ initialVisualState;946 UIVisualStateType m_enmInitialVisualState; 947 947 /** Holds current visual state. */ 948 UIVisualStateType m_ visualState;948 UIVisualStateType m_enmVisualState; 949 949 /** Holds visual state which should be entered when possible. */ 950 950 UIVisualStateType m_enmRequestedVisualState; … … 988 988 ** @{ */ 989 989 /** Holds the list of desired guest-screen visibility flags. */ 990 QVector<bool> m_ monitorVisibilityVectorHostDesires;990 QVector<bool> m_guestScreenVisibilityVectorHostDesires; 991 991 /** Holds the list of actual guest-screen visibility flags. */ 992 QVector<bool> m_ monitorVisibilityVector;992 QVector<bool> m_guestScreenVisibilityVector; 993 993 994 994 /** Holds the list of guest-screen full-screen sizes. */
Note:
See TracChangeset
for help on using the changeset viewer.