<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        color:black;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";
        color:black;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Balloon Text Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";
        color:black;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;
        color:black;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        color:black;}
p.HTML-esimuotoiltu, li.HTML-esimuotoiltu, div.HTML-esimuotoiltu
        {mso-style-name:HTML-esimuotoiltu;
        mso-style-link:"HTML-esimuotoiltu Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        color:black;}
span.HTML-esimuotoiltuChar
        {mso-style-name:"HTML-esimuotoiltu Char";
        mso-style-priority:99;
        mso-style-link:HTML-esimuotoiltu;
        font-family:Consolas;
        color:black;}
span.EmailStyle23
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","sans-serif";
        color:black;}
span.EmailStyle26
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 2.0cm 70.85pt 2.0cm;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body bgcolor="white" lang="FI" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">Yes. That is one case.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext">From:</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext"> Marcin Mielniczuk [mailto:marmistrzmar@gmail.com]
<br>
<b>Sent:</b> 19. helmikuuta 2018 9:55<br>
<b>To:</b> Sailfish OS Developers; Kimmo Lindholm<br>
<b>Subject:</b> Re: [SailfishDevel] Keep an application running without keeping the window open<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p>Do I understand correctly that the dbus daemons run as usual systemd --user daemons and simply communicate over dbus?<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">On 18.02.2018 22:59, Kimmo Lindholm wrote:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal"><span style="color:windowtext;mso-fareast-language:EN-US">One small daemon you can take a look is my call fhasher
<a href="https://github.com/kimmoli/callflasher">https://github.com/kimmoli/callflasher</a></span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:windowtext;mso-fareast-language:EN-US">for complex one, take a look at tohkbd2 . it has 2 daemons, system and user, and ui app that all communicate together over dbus</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:windowtext;mso-fareast-language:EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:windowtext;mso-fareast-language:EN-US">-kimmo</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:windowtext;mso-fareast-language:EN-US"> </span><o:p></o:p></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span style="color:windowtext">Lähettäjä:</span></b><span style="color:windowtext"> Devel [<a href="mailto:devel-bounces@lists.sailfishos.org">mailto:devel-bounces@lists.sailfishos.org</a>]
<b>Puolesta </b>Marcin Mielniczuk<br>
<b>Lähetetty:</b> sunnuntai 18. helmikuuta 2018 21.29<br>
<b>Vastaanottaja:</b> Adam Pigg <a href="mailto:adam@piggz.co.uk"><adam@piggz.co.uk></a>; Sailfish OS Developers
<a href="mailto:devel@lists.sailfishos.org"><devel@lists.sailfishos.org></a><br>
<b>Aihe:</b> Re: [SailfishDevel] Keep an application running without keeping the window open</span><o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt">Is there any minimal example I could take a look at? I've never done anything more with dbus than dbus-send.
<o:p></o:p></p>
<div>
<p class="MsoNormal">On 17.02.2018 22:06, Adam Pigg wrote:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">Hi<br>
<br>
You could create a dbus service for the application to talk to.  The gui application can launch the dbus service if it isnt running, and connect next time it is opened, leaving it running in the background.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Adam<o:p></o:p></p>
</div>
<p class="MsoNormal"> <o:p></o:p></p>
<div>
<div>
<p class="MsoNormal">On Sat, 17 Feb 2018 at 20:58 rinigus <<a href="mailto:rinigus.git@gmail.com" target="_blank">rinigus.git@gmail.com</a>> wrote:<o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt">
<div>
<p class="MsoNormal">Hi, <o:p></o:p></p>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">from the point of view of portability, having a split GUI and backend should be nicely portable. Even focusing on systemd would cover large portion of Linux distributions, but you don't have to include any systemd dependencies as such.
 On desktop, it would allow you to move the backend into dedicated hardware, if you wish. Also, it would survive X11 crashes as a bonus. So, if you plan to run it 24x7, service running on the background is a good way of doing it.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">But maybe someone has better idea.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Cheers,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Rinigus<o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
<div>
<p class="MsoNormal">On Sat, Feb 17, 2018 at 9:16 PM, Marcin Mielniczuk <<a href="mailto:marmistrzmar@gmail.com" target="_blank">marmistrzmar@gmail.com</a>> wrote:<o:p></o:p></p>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt">
<div>
<p>I'm not sure if that's a good choice when trying to achieve portability. Usually on desktop you'd rather have a monolithic application with just minimize to tray.<o:p></o:p></p>
<p>Any other options?<o:p></o:p></p>
<div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
<div>
<p class="MsoNormal">On 05.02.2018 10:33, rinigus wrote:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<p class="MsoNormal">Hi, <o:p></o:p></p>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">the obvious solution is to run service that is 24/7 on and separate client for GUI. That's what stock messaging is doing. I would recommend it and use some simple messaging API for communicating between them. There are probably many APIs
 to choose that will allow you to set it up simply.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">If you can withstand short shutdown of the service then you can combine it into the same application. It would require that application will start in GUI or server mode depending on command line option. If started in GUI mode, you would
 have to <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">* shut down service via systemd<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">* establish new connections<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">and on GUI exit you would have to <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">* drop all connections<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">* start service via systemd<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">The latter is the way OSM Scout Server works with the adjustment that its using systemd sockets to keep it switched off when user is not accessing it. Note that it was done for historical reasons (signaling between parts was implemented
 via Qt) and since its mostly used as a service anyway (users don't need to access GUI for weeks).<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">I would still recommend splitting service/GUI parts and use some messaging protocol in between. Myself I would have used zeromq, but you could choose probably many others.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Cheers,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Rinigus<o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
<div>
<p class="MsoNormal">On Mon, Feb 5, 2018 at 11:17 AM, Marcin Mielniczuk <<a href="mailto:marmistrzmar@gmail.com" target="_blank">marmistrzmar@gmail.com</a>> wrote:<o:p></o:p></p>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt">
<p class="MsoNormal">Hi,<br>
<br>
When creating SFOS applications which should run 24/7 (e.g. IMs) we<br>
would like to achieve similar behavior as the stock applications, e.g.<br>
the stock e-mail client: the sync (*) runs in the background, even<br>
though the application is closed. A window staying open just to make<br>
sure the sync goes on clutters the open app view and makes it more<br>
difficult to manage the open applications.<br>
<br>
On a desktop DE one would simply minimize the application to tray.<br>
Alternatively, one could create a daemon which the client app would<br>
communicate with using UNIX sockets, but it greatly increases the<br>
complexity of the application and slows down the development.<br>
<br>
What's the easiest way to keep the sync process in the background<br>
without keeping the window open?<br>
<br>
Regards,<br>
Marcin<br>
<br>
(*) when speaking sync, I mean any kind of waiting for a remote event,<br>
no matter if it's done by idle TCP (which is good) or HTTP polling<br>
(which is not good)<br>
<br>
<br>
_______________________________________________<br>
SailfishOS.org Devel mailing list<br>
To unsubscribe, please send a mail to <a href="mailto:devel-unsubscribe@lists.sailfishos.org" target="_blank">
devel-unsubscribe@lists.sailfishos.org</a><o:p></o:p></p>
</blockquote>
</div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<p class="MsoNormal"><br>
<br>
<br>
<o:p></o:p></p>
<pre>_______________________________________________<o:p></o:p></pre>
<pre>SailfishOS.org Devel mailing list<o:p></o:p></pre>
<pre>To unsubscribe, please send a mail to <a href="mailto:devel-unsubscribe@lists.sailfishos.org" target="_blank">devel-unsubscribe@lists.sailfishos.org</a><o:p></o:p></pre>
</blockquote>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
</div>
</div>
</blockquote>
</div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<p class="MsoNormal">_______________________________________________<br>
SailfishOS.org Devel mailing list<br>
To unsubscribe, please send a mail to <a href="mailto:devel-unsubscribe@lists.sailfishos.org" target="_blank">
devel-unsubscribe@lists.sailfishos.org</a><o:p></o:p></p>
</blockquote>
</div>
</div>
</blockquote>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""><br>
<br>
<br>
<o:p></o:p></span></p>
<pre>_______________________________________________<o:p></o:p></pre>
<pre>SailfishOS.org Devel mailing list<o:p></o:p></pre>
<pre>To unsubscribe, please send a mail to <a href="mailto:devel-unsubscribe@lists.sailfishos.org">devel-unsubscribe@lists.sailfishos.org</a><o:p></o:p></pre>
</blockquote>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""><o:p> </o:p></span></p>
</div>
</body>
</html>