Changeset 88633 in vbox for trunk/src/VBox
- Timestamp:
- Apr 21, 2021 12:43:05 PM (4 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/runtime
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.cpp
r84990 r88633 137 137 } 138 138 139 void UIMachine::setRequestedVisualState(UIVisualStateType visualStateType) 140 { 141 /* Remember requested visual state: */ 142 m_enmRequestedVisualState = visualStateType; 143 144 /* Save only if it's different from Invalid and from current one: */ 145 if ( m_enmRequestedVisualState != UIVisualStateType_Invalid 146 && gEDataManager->requestedVisualState(uiCommon().managedVMUuid()) != m_enmRequestedVisualState) 147 gEDataManager->setRequestedVisualState(m_enmRequestedVisualState, uiCommon().managedVMUuid()); 148 } 149 150 UIVisualStateType UIMachine::requestedVisualState() const 151 { 152 return m_enmRequestedVisualState; 153 } 154 139 155 void UIMachine::closeRuntimeUI() 140 156 { … … 193 209 , m_initialVisualState(UIVisualStateType_Normal) 194 210 , m_visualState(UIVisualStateType_Invalid) 211 , m_enmRequestedVisualState(UIVisualStateType_Invalid) 195 212 , m_pMachineLogic(0) 196 213 { … … 250 267 m_allowedVisualStates = static_cast<UIVisualStateType>(UIVisualStateType_All ^ restrictedVisualStates); 251 268 252 /* Load requested visual state : */253 UIVisualStateType requestedVisualState = gEDataManager->requestedVisualState(uiCommon().managedVMUuid());269 /* Load requested visual state, it can override initial one: */ 270 m_enmRequestedVisualState = gEDataManager->requestedVisualState(uiCommon().managedVMUuid()); 254 271 /* Check if requested visual state is allowed: */ 255 if (isVisualStateAllowed( requestedVisualState))256 { 257 switch ( requestedVisualState)272 if (isVisualStateAllowed(m_enmRequestedVisualState)) 273 { 274 switch (m_enmRequestedVisualState) 258 275 { 259 /* Direct transition to scale/fullscreen mode allowed: */276 /* Direct transition allowed to scale/fullscreen modes only: */ 260 277 case UIVisualStateType_Scale: m_initialVisualState = UIVisualStateType_Scale; break; 261 278 case UIVisualStateType_Fullscreen: m_initialVisualState = UIVisualStateType_Fullscreen; break; 262 /* While to seamless is not, so we have to make request to do transition later: */263 case UIVisualStateType_Seamless: uisession()->setRequestedVisualState(UIVisualStateType_Seamless); break;264 279 default: break; 265 280 } … … 272 287 void UIMachine::cleanupMachineLogic() 273 288 { 274 /* Session UI can have requested visual state: */275 if (uisession())276 {277 /* Get requested visual state: */278 UIVisualStateType requestedVisualState = uisession()->requestedVisualState();279 /* Or current visual state if requested is invalid: */280 if (requestedVisualState == UIVisualStateType_Invalid)281 requestedVisualState = m_visualState;282 283 /* Save requested visual state: */284 gEDataManager->setRequestedVisualState(requestedVisualState, uiCommon().managedVMUuid());285 }286 287 289 /* Destroy machine-logic if exists: */ 288 290 if (m_pMachineLogic) -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.h
r82968 r88633 73 73 void asyncChangeVisualState(UIVisualStateType visualStateType); 74 74 75 /** Requests visual-state to be entered when possible. */ 76 void setRequestedVisualState(UIVisualStateType visualStateType); 77 /** Returns requested visual-state to be entered when possible. */ 78 UIVisualStateType requestedVisualState() const; 79 75 80 /** Close Runtime UI. */ 76 81 void closeRuntimeUI(); … … 117 122 /** Holds current visual state. */ 118 123 UIVisualStateType m_visualState; 124 /** Holds visual state which should be entered when possible. */ 125 UIVisualStateType m_enmRequestedVisualState; 119 126 /** Holds current machine-logic. */ 120 127 UIMachineLogic *m_pMachineLogic; -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp
r85772 r88633 508 508 } 509 509 510 void UISession::setRequestedVisualState(UIVisualStateType visualStateType) 511 { 512 m_pMachine->setRequestedVisualState(visualStateType); 513 } 514 515 UIVisualStateType UISession::requestedVisualState() const 516 { 517 return m_pMachine->requestedVisualState(); 518 } 519 510 520 bool UISession::setPause(bool fOn) 511 521 { … … 942 952 , m_machineState(KMachineState_Null) 943 953 , m_pMachineWindowIcon(0) 944 , m_requestedVisualStateType(UIVisualStateType_Invalid)945 954 #ifdef VBOX_WS_WIN 946 955 , m_alphaCursor(0) -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h
r82968 r88633 179 179 void changeVisualState(UIVisualStateType visualStateType); 180 180 /** Requests visual-state to be entered when possible. */ 181 void setRequestedVisualState(UIVisualStateType visualStateType) { m_requestedVisualStateType = visualStateType; }181 void setRequestedVisualState(UIVisualStateType visualStateType); 182 182 /** Returns requested visual-state to be entered when possible. */ 183 UIVisualStateType requestedVisualState() const { return m_requestedVisualStateType; }183 UIVisualStateType requestedVisualState() const; 184 184 185 185 bool isSaved() const { return machineState() == KMachineState_Saved; } … … 529 529 /** @} */ 530 530 531 /** @name Visual-state configuration variables.532 ** @{ */533 /** Determines which visual-state should be entered when possible. */534 UIVisualStateType m_requestedVisualStateType;535 /** @} */536 537 531 #if defined(VBOX_WS_WIN) 538 532 HCURSOR m_alphaCursor;
Note:
See TracChangeset
for help on using the changeset viewer.