From mcpain@basealt.ru  Mon Apr  6 09:56:37 2020
Received: (at 1447) by bugs.x2go.org; 6 Apr 2020 07:56:39 +0000
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on
	ymir.das-netzwerkteam.de
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00,SPF_HELO_NONE,
	URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2
Received: from air.basealt.ru (air.basealt.ru [194.107.17.39])
	by ymir.das-netzwerkteam.de (Postfix) with ESMTPS id EE6C55DAC1
	for <1447@bugs.x2go.org>; Mon,  6 Apr 2020 09:56:28 +0200 (CEST)
Received: by air.basealt.ru (Postfix, from userid 490)
	id CFBBA5895A8; Mon,  6 Apr 2020 07:56:26 +0000 (UTC)
Received: from comp-core-i7-7700hq-8bbb5b.localdomain (unknown [185.135.150.181])
	by air.basealt.ru (Postfix) with ESMTPSA id 1C5BC589597
	for <1447@bugs.x2go.org>; Mon,  6 Apr 2020 07:56:23 +0000 (UTC)
From: mcpain@basealt.ru
To: 1447@bugs.x2go.org
Subject: Bug#1447: x2godesktopsharing termination
Date: Mon, 06 Apr 2020 10:56:22 +0300
Message-ID: <1696701.EdgVmMA29B@comp-core-i7-7700hq-8bbb5b.localdomain>
In-Reply-To: <1979176.hEZOCWH5ES@comp-core-i7-7700hq-8bbb5b.localdomain>
References: <2551710.cTBtcbKS0m@work-pc.localdomain> <1979176.hEZOCWH5ES@comp-core-i7-7700hq-8bbb5b.localdomain>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="nextPart2856700.yyy93DhdbZ"
Content-Transfer-Encoding: 7Bit

This is a multi-part message in MIME format.

--nextPart2856700.yyy93DhdbZ
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset="UTF-8"

=D0=92 =D0=BF=D0=B8=D1=81=D1=8C=D0=BC=D0=B5 =D0=BE=D1=82 =D1=81=D1=80=D0=B5=
=D0=B4=D0=B0, 1 =D0=B0=D0=BF=D1=80=D0=B5=D0=BB=D1=8F 2020 =D0=B3. 15:10:50 =
MSK =D0=BF=D0=BE=D0=BB=D1=8C=D0=B7=D0=BE=D0=B2=D0=B0=D1=82=D0=B5=D0=BB=D1=
=8C=20
mcpain@basealt.ru =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BB:
> Also reproducible on:
> Fedora 29 (MATE)
> Ubuntu 19.10 (MATE)
> _______________________________________________
> x2go-dev mailing list
> x2go-dev@lists.x2go.org
> https://lists.x2go.org/listinfo/x2go-dev

When QCoreApplicationPrivate::maybeQuit() is called, quitLockRef.load() =3D=
=3D 0,=20
hence QEvent::Quit is sent on MATE and application terminates.
KDE is fine because there is plasma-integration package, which provides=20
KDEPlatformSystemTrayIcon and quitLockRef.load() !=3D 0 when maybeQuit() is=
=20
called.

Took a look at other Qt5 applications like Psi+ and made a patch with simil=
ar=20
workaround.
--nextPart2856700.yyy93DhdbZ
Content-Disposition: attachment; filename="alt-fix-quit.patch"
Content-Transfer-Encoding: 7Bit
Content-Type: text/x-patch; charset="UTF-8"; name="alt-fix-quit.patch"

diff --git a/main.cpp b/main.cpp
index f01efbc..8a87103 100644
--- a/main.cpp
+++ b/main.cpp
@@ -133,6 +133,7 @@ int main ( int argc, char *argv[] )
 		}
 	}
 
+	QApplication::setQuitOnLastWindowClosed(false);
 	QApplication app ( argc,argv );
 	QStringList args=QCoreApplication::arguments();
 
diff --git a/sharetray.cpp b/sharetray.cpp
index 2fcce62..1bf8c26 100644
--- a/sharetray.cpp
+++ b/sharetray.cpp
@@ -771,6 +771,7 @@ void ShareTray::slotDelListItem()
 void ShareTray::slotMenuClose()
 {
 	menuClose=true;
+	QApplication::setQuitOnLastWindowClosed(true);
 	close();
 }
 

--nextPart2856700.yyy93DhdbZ--



