summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qguiapplication.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/kernel/qguiapplication.cpp')
-rw-r--r--src/gui/kernel/qguiapplication.cpp88
1 files changed, 1 insertions, 87 deletions
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp
index d3e97ebe5c..b8acf5c396 100644
--- a/src/gui/kernel/qguiapplication.cpp
+++ b/src/gui/kernel/qguiapplication.cpp
@@ -162,10 +162,6 @@ QPlatformTheme *QGuiApplicationPrivate::platform_theme = nullptr;
QList<QObject *> QGuiApplicationPrivate::generic_plugin_list;
-#ifndef QT_NO_SESSIONMANAGER
-bool QGuiApplicationPrivate::is_fallback_session_management_enabled = true;
-#endif
-
enum ApplicationResourceFlags
{
ApplicationFontExplicitlySet = 0x2
@@ -721,9 +717,6 @@ QGuiApplication::~QGuiApplication()
QGuiApplicationPrivate::highDpiScalingUpdated = false;
QGuiApplicationPrivate::currentDragWindow = nullptr;
QGuiApplicationPrivate::tabletDevicePoints.clear();
-#ifndef QT_NO_SESSIONMANAGER
- QGuiApplicationPrivate::is_fallback_session_management_enabled = true;
-#endif
QGuiApplicationPrivate::mousePressTime = 0;
QGuiApplicationPrivate::mousePressX = QGuiApplicationPrivate::mousePressY = 0;
}
@@ -3649,27 +3642,6 @@ bool QGuiApplicationPrivate::shouldQuitInternal(const QWindowList &processedWind
return true;
}
-bool QGuiApplicationPrivate::tryCloseAllWindows()
-{
- return tryCloseRemainingWindows(QWindowList());
-}
-
-bool QGuiApplicationPrivate::tryCloseRemainingWindows(QWindowList processedWindows)
-{
- QWindowList list = QGuiApplication::topLevelWindows();
- for (int i = 0; i < list.size(); ++i) {
- QWindow *w = list.at(i);
- if (w->isVisible() && !processedWindows.contains(w)) {
- if (!w->close())
- return false;
- processedWindows.append(w);
- list = QGuiApplication::topLevelWindows();
- i = -1;
- }
- }
- return true;
-}
-
void QGuiApplicationPrivate::processApplicationTermination(QWindowSystemInterfacePrivate::WindowSystemEvent *windowSystemEvent)
{
QEvent event(QEvent::Quit);
@@ -3771,57 +3743,6 @@ void QGuiApplicationPrivate::setApplicationState(Qt::ApplicationState state, boo
emit qApp->applicationStateChanged(applicationState);
}
-#ifndef QT_NO_SESSIONMANAGER
-// ### Qt6: consider removing the feature or making it less intrusive
-/*!
- \since 5.6
-
- Returns whether QGuiApplication will use fallback session management.
-
- The default is \c true.
-
- If this is \c true and the session manager allows user interaction,
- QGuiApplication will try to close toplevel windows after
- commitDataRequest() has been emitted. If a window cannot be closed, session
- shutdown will be canceled and the application will keep running.
-
- Fallback session management only benefits applications that have an
- "are you sure you want to close this window?" feature or other logic that
- prevents closing a toplevel window depending on certain conditions, and
- that do nothing to explicitly implement session management. In applications
- that \e do implement session management using the proper session management
- API, fallback session management interferes and may break session
- management logic.
-
- \warning If all windows \e are closed due to fallback session management
- and quitOnLastWindowClosed() is \c true, the application will quit before
- it is explicitly instructed to quit through the platform's session
- management protocol. That violation of protocol may prevent the platform
- session manager from saving application state.
-
- \sa setFallbackSessionManagementEnabled(),
- QSessionManager::allowsInteraction(), saveStateRequest(),
- commitDataRequest(), {Session Management}
-*/
-bool QGuiApplication::isFallbackSessionManagementEnabled()
-{
- return QGuiApplicationPrivate::is_fallback_session_management_enabled;
-}
-
-/*!
- \since 5.6
-
- Sets whether QGuiApplication will use fallback session management to
- \a enabled.
-
- \sa isFallbackSessionManagementEnabled()
-*/
-void QGuiApplication::setFallbackSessionManagementEnabled(bool enabled)
-{
- QGuiApplicationPrivate::is_fallback_session_management_enabled = enabled;
-}
-#endif // QT_NO_SESSIONMANAGER
-
/*!
\since 4.2
\fn void QGuiApplication::commitDataRequest(QSessionManager &manager)
@@ -3846,8 +3767,7 @@ void QGuiApplication::setFallbackSessionManagementEnabled(bool enabled)
\note You should use Qt::DirectConnection when connecting to this signal.
- \sa setFallbackSessionManagementEnabled(), isSessionRestored(),
- sessionId(), saveStateRequest(), {Session Management}
+ \sa isSessionRestored(), sessionId(), saveStateRequest(), {Session Management}
*/
/*!
@@ -3955,13 +3875,7 @@ void QGuiApplicationPrivate::commitData()
{
Q_Q(QGuiApplication);
is_saving_session = true;
-
emit q->commitDataRequest(*session_manager);
- if (is_fallback_session_management_enabled && session_manager->allowsInteraction()
- && !tryCloseAllWindows()) {
- session_manager->cancel();
- }
-
is_saving_session = false;
}