path: root/src/gui/kernel/qguiapplication.h
diff options
authorAndreas Hartmetz <>2016-01-19 14:30:18 +0100
committerJani Heikkinen <>2016-02-15 16:10:20 +0000
commite7bf0edfd49de9a4d8285fbe8d878f8fda910e6d (patch)
treefa51fbe7c13dc48ea0e79fd7646dbbda5b8c5e68 /src/gui/kernel/qguiapplication.h
parent8c2b4266002736da499d169a0da187e5cdc5381a (diff)
Add option to disable "session management by closing windows".
That feature is a poor man's session management for applications that do not implement any specific session management features. It badly interferes with proper session management support, so applications must be able to disable it. This enables fixing applications with QGuiApplication::quitOnLastWindowClosed() true - the default - dying too early, before they are enumerated for the list of applications to restart on session restore, thus preventing them from being restored. See [ChangeLog][QtGui] Qt asking to close windows on session exit as a fallback session management mechanism has been made optional. Disabling it fixes session management for applications that implement full session management. See QGuiApplication::isFallbackSessionManagementEnabled(). Task-number: QTBUG-49667 Change-Id: Ib22e58c9c64351dea8b7e2a74db91d26dd7ab7aa Reviewed-by: Oswald Buddenhagen <> Reviewed-by: David Faure <>
Diffstat (limited to 'src/gui/kernel/qguiapplication.h')
1 files changed, 3 insertions, 0 deletions
diff --git a/src/gui/kernel/qguiapplication.h b/src/gui/kernel/qguiapplication.h
index d995387d66..3f233d4eda 100644
--- a/src/gui/kernel/qguiapplication.h
+++ b/src/gui/kernel/qguiapplication.h
@@ -152,6 +152,9 @@ public:
QString sessionId() const;
QString sessionKey() const;
bool isSavingSession() const;
+ static bool isFallbackSessionManagementEnabled();
+ static void setFallbackSessionManagementEnabled(bool);
static void sync();