<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Thank you for explaining this, Thiago!<div class=""><br class=""></div><div class="">Then it means the unregistration code kwin_x11 will not be executed. Although I</div><div class="">still don’t know who/why terminates the session but it is something I can use.</div><div class=""><br class=""></div><div class="">* in kwin_x11, I need to add a watcher for session disconnected, and close</div><div class="">kwin_x11 event loop on that </div><div class="">* in startkde, I need to add a timer to query registration status. My test app shows</div><div class="">that the service becomes unregistered after a few seconds. QDBusServiceWatcher </div><div class="">cannot send a unregistration event/signal if org.kde.KWin is terminated passively.</div><div class=""><br class=""></div><div class="">Thank you! I will do more tests on that. </div><div class=""><span class=""><br class=""><blockquote type="cite" class="">On Nov 8, 2020, at 09:03, Thiago Macieira <<a href="mailto:thiago@kde.org" class="">thiago@kde.org</a>> wrote:<br class=""><br class="">On Saturday, 7 November 2020 19:26:26 PST Sheng Mao wrote:<br class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">Sorry I missed some important information here. Please forgive me that I am<br class="">not very familiar with field.<br class=""><blockquote type="cite" class="">However, I use busctl —user monitor org.kde.KWin, it seems<br class="">org.freedesktop.DBus.Local.Disconnected signal is issued, so the service<br class="">is not unregistered.<br class=""></blockquote><br class="">The reason is I modified startkde to watch for unregistration of service<br class="">org.kde.KWin, and after the unregistration, startkde should exit. However,<br class="">I use busctl to monitor org.kde.KWin (busctl keeps running and waits for<br class="">log messages), org.freedesktop.DBus.Local.Disconnected signal shows up in<br class="">the log as the last message and busctl stops working. Then I use busctl to<br class="">check if org.kde.KWin still exits and the service actually disappears. But<br class="">when I use QDBusConnectionInterface::isServiceRegistered to check if<br class="">org.kde.KWin is still registered and the result is the service still is<br class="">registered.<br class=""></blockquote><br class="">This signal means the bus daemon disconnected your client and this happens <br class="">because the bus daemon isi exiting, closing the connection to all clients.<br class=""><br class="">I think this is sufficient information for you You don't need further <br class="">deregistration information: the session is over.<br class=""><br class="">-- <br class="">Thiago Macieira - thiago (AT) <a href="http://macieira.info" class="">macieira.info</a> - thiago (AT) kde.org<br class=""> Software Architect - Intel DPG Cloud Engineering<br class=""><br class=""><br class=""><br class="">_______________________________________________<br class="">dbus mailing list<br class="">dbus@lists.freedesktop.org<br class="">https://lists.freedesktop.org/mailman/listinfo/dbus<br class=""></blockquote></span><br class=""></div></body></html>