[SailfishDevel] Close app in background with visible overlay
David Llewellyn-Jones
david at flypig.co.uk
Wed Dec 4 00:48:52 UTC 2019
It looks like one solution would be to set the application view as the
parent of your overlay view. I created a PR along these lines:
https://github.com/yurumi/harbour-schwarzenmaker/pull/16
On 03/12/2019 16:26, Thomas Eigel wrote:
> Sure!
>
> Goal: I want to close my app from home screen when an overlay is visible.
> Problem: The cover disappears but the app itself is still running (e.g.
> overlay can be seen, process still existing).
> Question: How can I close the app correctly - including the overlay?
>
> Thanks,
> Thomas
>
> PS: If still unclear, user Najoj opened an issue describing the problem:
> https://github.com/yurumi/harbour-schwarzenmaker/issues/15
>
> @Андрей: I think, I borrowed the code for the overlay from you a few
> years ago. Thanks for that and all your support!
>
> *Gesendet:* Dienstag, 03. Dezember 2019 um 08:10 Uhr
> *Von:* "Андрей Кожевников" <coderusinbox at gmail.com>
> *An:* "Sailfish OS Developers" <devel at lists.sailfishos.org>
> *Betreff:* Re: [SailfishDevel] Close app in background with visible overlay
> Hello. Please repeat your actual question. I dont understand what the
> problem is and what are you trying to achieve.
>
> вт, 3 дек. 2019 г. в 01:27, Thomas Eigel <yurumi at gmx.de
> <mailto:yurumi at gmx.de>>:
>
> 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
> _______________________________________________
> SailfishOS.org Devel mailing list
> To unsubscribe, please send a mail to
> devel-unsubscribe at lists.sailfishos.org
> <mailto:devel-unsubscribe at lists.sailfishos.org>
>
> _______________________________________________ SailfishOS.org Devel
> mailing list To unsubscribe, please send a mail to
> devel-unsubscribe at lists.sailfishos.org
>
> _______________________________________________
> SailfishOS.org Devel mailing list
> To unsubscribe, please send a mail to devel-unsubscribe at lists.sailfishos.org
>
--
Website: http://www.flypig.co.uk
More information about the Devel
mailing list