touch-packages team mailing list archive
-
touch-packages team
-
Mailing list archive
-
Message #126133
[Bug 1456706] Re: QGuiApplication::applicationState is never Qt::ApplicationSuspended
Status changed to 'Confirmed' because the bug affects multiple users.
** Changed in: qtubuntu (Ubuntu)
Status: New => Confirmed
--
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to qtubuntu in Ubuntu.
https://bugs.launchpad.net/bugs/1456706
Title:
QGuiApplication::applicationState is never Qt::ApplicationSuspended
Status in qtubuntu package in Ubuntu:
Confirmed
Bug description:
In Oxide, I want to be able to flush profile data before an
application is suspended on the phone, in case the application gets
killed before it's reactivated again. I expected to be able to do this
by connecting to QGuiApplication::applicationStateChanged and
detecting when the state changes to Qt::ApplicationSuspended.
From the documentation, this does seem to be the most appropriate
state:
"The application is about to suspend. When entering this state, the
application should save its state, cease all activities, and be
prepared for code execution to stop. While suspended, the application
can be killed at any time without further warnings (e.g. when low
memory forces the OS to purge suspended applications)."
However, I only ever see 2 states - Qt::ApplicationActive and
Qt::ApplicationInactive.
For now, I've made Oxide flush profile data when the state changes to
ApplicationInactive. However, I think that this behaviour is wrong
when the Qt platform is not qtubuntu. Eg, on the desktop with the xcb
platform, the application state changes to Qt::ApplicationInactive
whenever none of its windows are in focus but the application is still
running. I don't think we should be flushing state every time a window
is unfocused.
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/qtubuntu/+bug/1456706/+subscriptions
References