Changeset 102419 in vbox
- Timestamp:
- Dec 1, 2023 1:30:48 PM (17 months ago)
- svn:sync-xref-src-repo-rev:
- 160562
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/runtime
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.cpp
r102018 r102419 1121 1121 /* Asynchronously ask QApplication to quit: */ 1122 1122 LogRel(("GUI: Request for async QApp quit.\n")); 1123 m_fQuitRequested = true; 1123 1124 QMetaObject::invokeMethod(qApp, "quit", Qt::QueuedConnection); 1124 1125 } … … 1471 1472 , m_defaultCloseAction(MachineCloseAction_Invalid) 1472 1473 , m_restrictedCloseActions(MachineCloseAction_Invalid) 1474 , m_fQuitRequested(false) 1473 1475 { 1474 1476 s_pInstance = this; -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.h
r102018 r102419 680 680 bool acquireWhetherGuestEnteredACPIMode(bool &fEntered); 681 681 682 /** Returns whether qpp quit is requested. */ 683 bool isQuitRequested() const { return m_fQuitRequested; } 684 682 685 /** Detaches and closes Runtime UI. */ 683 686 void detachUi(); … … 1107 1110 /** Merged restricted close actions. */ 1108 1111 MachineCloseAction m_restrictedCloseActions; 1112 1113 /** Holds whether app quit is requested. */ 1114 bool m_fQuitRequested; 1109 1115 /** @} */ 1110 1116 }; -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineWindow.cpp
r100153 r102419 360 360 void UIMachineWindow::closeEvent(QCloseEvent *pCloseEvent) 361 361 { 362 /* Fast handling in case if session is invalid: */ 363 if (!uimachine()->isSessionValid()) 362 /* Always ignore close-event first: */ 363 pCloseEvent->ignore(); 364 /* But accept close-event if app quit was requested: */ 365 if (uimachine()->isQuitRequested()) 366 { 367 pCloseEvent->accept(); 368 return; 369 } 370 371 /* In certain cases we need to just request app quit: */ 372 if ( !uimachine()->isSessionValid() 373 || uimachine()->isTurnedOff()) 364 374 { 365 375 uimachine()->closeRuntimeUI(); … … 367 377 } 368 378 369 /* Always ignore close-event first: */370 pCloseEvent->ignore();371 372 379 /* Make sure machine is in one of the allowed states: */ 373 380 if (!uimachine()->isRunning() && !uimachine()->isPaused() && !uimachine()->isStuck()) 374 {375 #ifdef VBOX_IS_QT6_OR_LATER /** @todo qt6 ... */376 /* If we want to close the application, we need to accept the close event.377 If we don't the QEvent::Quit processing in QApplication::event fails and378 [QCocoaApplicationDelegate applicationShouldTerminate] complains printing379 "Qt DEBUG: Application termination canceled" in the debug log. */380 /** @todo qt6: This could easily be caused by something else, but needs to be381 * looked at by a proper GUI expert. */382 if (uimachine()->isTurnedOff()) /** @todo qt6: Better state check here? */383 pCloseEvent->accept();384 #endif385 381 return; 386 }387 382 388 383 /* If there is a close hook script defined: */
Note:
See TracChangeset
for help on using the changeset viewer.