Uses deprecated QEvent::ApplicationActivate

Bug #1504776 reported by Sam Segers on 2015-10-10
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Canonical System Image
Undecided
kevin gunn
qtubuntu (Ubuntu)
Undecided
Daniel d'Andrada

Bug Description

qtubuntu plugin uses the ApplicationActivate and ApplicationDeactivate QEvents for life cycle management.
These have become deprecated and been replaced by Qt::ApplicationState since Qt5.1

The states should be set with:

    QWindowSystemInterface::handleApplicationStateChanged(Qt::ApplicationState state)

The qtnamespace docs:
/*!
    \enum Qt::ApplicationState

    \keyword application state

    This enum type is used to specify the current state of the application.

    The states are

    \value ApplicationSuspended 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).
    \value ApplicationHidden The application is hidden and runs in the background. This
                                   is the normal state for applications that need to do background
                                   processing, like playing music, while the user interacts with
                                   other applications. The application should free up all graphical
                                   resources when entering this state.
    \value ApplicationInactive The application is visible, but not selected to be in front.
                                   On desktop platforms, this typically means that the user
                                   activated another application. On mobile platforms, it is
                                   more common to enter this state when the OS is interrupting
                                   the user with e.g. incoming calls or SMS-messages.
                                   While in this state, consider reducing CPU-intensive tasks.
    \value ApplicationActive The application is visible and selected to be in front.

    \since 5.1
*/

This will also make it possible to set more appropriate life cycle states. We can then react to Qt.ApplicationSuspended on the application.state object from QML to react when the application gets suspended.

UbuntuClientIntegration::hasCapability should then also return true with ApplicationState

Related branches

Sam Segers (sam-sgrs) wrote :

Proposed a fix

affects: qtubuntu → qtubuntu (Ubuntu)
Sam Segers (sam-sgrs) on 2015-10-31
affects: qtubuntu (Ubuntu) → qtubuntu
summary: - Uses depricated QEvent::ApplicationActivate
+ Uses deprecated QEvent::ApplicationActivate
Changed in qtubuntu:
assignee: nobody → Daniel d'Andrada (dandrader)
status: New → In Progress
Changed in canonical-devices-system-image:
status: New → Fix Committed
assignee: nobody → kevin gunn (kgunn72)
milestone: none → ww02-2016
Michał Sawicz (saviq) on 2015-12-11
Changed in qtubuntu:
status: In Progress → Fix Released
Changed in canonical-devices-system-image:
status: Fix Committed → Fix Released
Michał Sawicz (saviq) on 2017-03-13
affects: qtubuntu → qtubuntu (Ubuntu)
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers