Changeset 98674 in vbox
- Timestamp:
- Feb 21, 2023 2:18:51 PM (2 years ago)
- svn:sync-xref-src-repo-rev:
- 155974
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/runtime
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.cpp
r98670 r98674 294 294 { 295 295 uisession()->forgetPreviousMachineState(); 296 } 297 298 bool UIMachine::acquireLiveMachineState(KMachineState &enmState) 299 { 300 return uisession()->acquireLiveMachineState(enmState); 296 301 } 297 302 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.h
r98670 r98674 214 214 /** @name Machine-state stuff. 215 215 ** @{ */ 216 /** Returns machine state. */216 /** Returns cached machine state. */ 217 217 KMachineState machineState() const; 218 218 219 219 /** Resets previous state to be the same as current one. */ 220 220 void forgetPreviousMachineState(); 221 222 /** Acquire live machine state. */ 223 bool acquireLiveMachineState(KMachineState &enmState); 221 224 222 225 /** Returns whether VM is in one of turned off states. */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp
r98670 r98674 1056 1056 // We can't take pause pixmap if actual state is Saving, this produces 1057 1057 // a lock and GUI will be frozen until SaveState call is complete... 1058 const KMachineState enmActualState = machine().GetState(); 1058 KMachineState enmActualState = KMachineState_Null; 1059 uimachine()->acquireLiveMachineState(enmActualState); 1059 1060 if (enmActualState != KMachineState_Saving) 1060 1061 { … … 1266 1267 { 1267 1268 #ifdef VBOX_WS_X11 1268 /* Processing pseudo resize-event to synchronize frame-buffer with stored framebuffer size. 1269 * On X11 this will be additional done when the machine state was 'saved'. */ 1270 if (machine().GetState() == KMachineState_Saved || machine().GetState() == KMachineState_AbortedSaved) 1269 // WORKAROUND: 1270 // Processing pseudo resize-event to synchronize frame-buffer with stored framebuffer size. 1271 // On X11 this have to be additionally done when the machine state was 'saved'. 1272 KMachineState enmActualState = KMachineState_Null; 1273 uimachine()->acquireLiveMachineState(enmActualState); 1274 if (enmActualState == KMachineState_Saved || enmActualState == KMachineState_AbortedSaved) 1271 1275 size = storedGuestScreenSizeHint(); 1272 1276 #endif /* VBOX_WS_X11 */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp
r98670 r98674 257 257 { 258 258 return mainMachineWindow() ? mainMachineWindow()->winId() : 0; 259 } 260 261 bool UISession::acquireLiveMachineState(KMachineState &enmState) 262 { 263 CMachine comMachine = machine(); 264 KMachineState enmMachineState = comMachine.GetState(); 265 const bool fSuccess = comMachine.isOk(); 266 if (!fSuccess) 267 UINotificationMessage::cannotAcquireMachineParameter(comMachine); 268 else 269 enmState = enmMachineState; 270 return fSuccess; 259 271 } 260 272 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h
r98670 r98674 199 199 /** Returns previous machine state. */ 200 200 KMachineState machineStatePrevious() const { return m_enmMachineStatePrevious; } 201 /** Returns machine state. */201 /** Returns cached machine state. */ 202 202 KMachineState machineState() const { return m_enmMachineState; } 203 203 204 204 /** Resets previous state to be the same as current one. */ 205 205 void forgetPreviousMachineState() { m_enmMachineStatePrevious = m_enmMachineState; } 206 207 /** Acquire live machine state. */ 208 bool acquireLiveMachineState(KMachineState &enmState); 206 209 207 210 /** Returns whether VM is in one of saved states. */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineWindowNormal.cpp
r98491 r98674 408 408 UIDesktopWidgetWatchdog::setTopLevelGeometry(this, m_geometry); 409 409 410 /* If previous machine-state was NOT SAVED => normalize window to the optimal-size: */ 411 if (machine().GetState() != KMachineState_Saved && machine().GetState() != KMachineState_AbortedSaved) 410 /* If actual machine-state is NOT saved => normalize window to the optimal-size: */ 411 KMachineState enmActualState = KMachineState_Null; 412 uimachine()->acquireLiveMachineState(enmActualState); 413 if (enmActualState != KMachineState_Saved && enmActualState != KMachineState_AbortedSaved) 412 414 normalizeGeometry(false /* adjust position */, shouldResizeToGuestDisplay()); 413 415
Note:
See TracChangeset
for help on using the changeset viewer.