"Quit" from quicklist doesn’t close all open windows, doesn’t actually quit the application
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Canonical System Image |
Fix Released
|
High
|
Michał Sawicz | ||
qtmir (Ubuntu) |
Fix Released
|
Undecided
|
Nick Dedekind | ||
unity8 (Ubuntu) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
I’m attaching a sample click application that contains a simple qml scene that opens several windows. This can be installed on a device with:
pkcon install-local --allow-untrusted fubar.osomon_
Initially, only one window is open, and tapping on any window opens one more window.
If I reveal the launcher and long press on the app’s icon to select the "Quit" option, not all windows are closed:
- if there is only one window open, it’s closed and the application successfully exits
- if there are two windows open, only the second window is closed, the first one remains open (and consequently the application is still running)
- if there are three windows open, only the first and third one are closed, the second one remains…
Expected behaviour: when "Quit" is tapped, all open windows are closed, and the application exits.
Related branches
- Daniel d'Andrada (community): Approve
- Unity8 CI Bot (community): Needs Fixing (continuous-integration)
-
Diff: 49 lines (+30/-1)2 files modifiedsrc/modules/Unity/Application/session.cpp (+3/-1)
tests/modules/SessionManager/session_test.cpp (+27/-0)
Changed in canonical-devices-system-image: | |
status: | New → Triaged |
importance: | Undecided → High |
assignee: | nobody → Michał Sawicz (saviq) |
milestone: | none → backlog |
Changed in qtmir (Ubuntu): | |
assignee: | nobody → Nick Dedekind (nick-dedekind) |
status: | New → In Progress |
Changed in canonical-devices-system-image: | |
status: | Triaged → In Progress |
milestone: | backlog → 14 |
Changed in canonical-devices-system-image: | |
status: | In Progress → Fix Committed |
Changed in unity8 (Ubuntu): | |
status: | Confirmed → Invalid |
Changed in canonical-devices-system-image: | |
status: | Fix Committed → Fix Released |
Here is the actual QML code contained in the example click package:
import QtQuick 2.4 .onCompleted: allWindows. push(this) .onDestruction: {
allWindows .splice( w, 1) Math.random( ), Math.random(), Math.random(), 1)
anchors. fill: parent createObject( null).show( ) log("quitting application, %1 windows open".arg( allWindows. length) ) onCompleted: windowFactory. createObject( null).show( )
import QtQuick.Window 2.2
QtObject {
readonly property var allWindows: []
property var windowFactory: Component {
Window {
onClosing: destroy()
Component
Component
for (var w in allWindows) {
if (this === allWindows[w]) {
return
}
}
}
Rectangle {
anchors {
fill: parent
margins: 20
}
color: Qt.rgba(
}
MouseArea {
onClicked: windowFactory.
}
}
}
property var applicationMonitor: Connections {
target: Qt.application
onAboutToQuit: console.
}
Component.
}