|
|
|
|
@ -138,21 +138,21 @@ void DisplayWidget::updateCursor(bool hidden)
|
|
|
|
|
|
|
|
|
|
void DisplayWidget::handleCloseEvent(QCloseEvent* event)
|
|
|
|
|
{
|
|
|
|
|
event->ignore();
|
|
|
|
|
|
|
|
|
|
// Closing the separate widget will either cancel the close, or trigger shutdown.
|
|
|
|
|
// In the latter case, it's going to destroy us, so don't let Qt do it first.
|
|
|
|
|
// Treat a close event while fullscreen as an exit, that way ALT+F4 closes DuckStation,
|
|
|
|
|
// rather than just the game.
|
|
|
|
|
if (QtHost::IsSystemValid() && !isActuallyFullscreen())
|
|
|
|
|
{
|
|
|
|
|
QMetaObject::invokeMethod(g_main_window, "requestShutdown", Q_ARG(bool, true), Q_ARG(bool, true),
|
|
|
|
|
Q_ARG(bool, false));
|
|
|
|
|
QMetaObject::invokeMethod(g_main_window, "requestShutdown", Qt::QueuedConnection, Q_ARG(bool, true),
|
|
|
|
|
Q_ARG(bool, true), Q_ARG(bool, false));
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
QMetaObject::invokeMethod(g_main_window, "requestExit");
|
|
|
|
|
QMetaObject::invokeMethod(g_main_window, "requestExit", Qt::QueuedConnection);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
event->ignore();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DisplayWidget::destroy()
|
|
|
|
|
|