[SailfishDevel] Close app in background with visible overlay
Sander van Grieken
sander at outright.solutions
Tue Dec 3 15:21:58 UTC 2019
You're creating a view and assigning it to m_overlayView twice.
Grtz,
Sander
On maandag 2 december 2019 23:27:40 CET Thomas Eigel wrote:
> Hi all,
>
> I have a quite special question: When my app (schwarzenmaker) runs in the background, an overlay is visible to show some kind of progress. If the app is closed from home screen the program keeps up running (cover disappears but 'ps aux' still showing the process and overlay still visible). Closing works as expected when the overlay is hidden beforehand.
>
> I tried listening to different signals but to no avail:
>
> - quit, aboutToQuit: Don't seem to be emitted since the program is not quitting until the overlay is hidden.
> - onStatusChanged: Is emitted when app is moved to background (Qt.ApplicationInactive) but no new signal when app is "closed".
>
> The code to create the overlay (which I don't fully understand) can be sketched as follows:
>
> m_overlayView = SailfishApp::createView();
> m_overlayView->setSource(SailfishApp::pathTo("qml/components/overlay.qml"));
> m_overlayView->create();
> QPlatformNativeInterface *native = QGuiApplication::platformNativeInterface();
> native->setWindowProperty(m_overlayView->handle(), QLatin1String("CATEGORY"), "notification");
> native->setWindowProperty(m_overlayView->handle(), QLatin1String("MOUSE_REGION"), QRegion(0, 0, 0, 0));
> m_overlayView = SailfishApp::createView();
>
> Maybe closing fails because another "window" is created. So my question is: Does anybody know how to detect the attempted closing of the app?
>
> Cheers,
> Thomas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.sailfishos.org/pipermail/devel/attachments/20191203/085f0476/attachment.html>
More information about the Devel
mailing list