changeset c719a04ecb31 in tryton:default
details: https://hg.tryton.org/tryton?cmd=changeset&node=c719a04ecb31
description:
        Support flatpak build

        Use 3 levels for application ID.
        Use XDG_RUNTIME_DIR as TMPDIR to share file outside the sandbox

        issue11250
        review390051002
diffstat:

 bin/tryton       |  5 +++++
 tryton/client.py |  2 +-
 2 files changed, 6 insertions(+), 1 deletions(-)

diffs (27 lines):

diff -r f67a6be959d6 -r c719a04ecb31 bin/tryton
--- a/bin/tryton        Sat Apr 30 22:29:38 2022 +0200
+++ b/bin/tryton        Mon May 02 10:22:20 2022 +0200
@@ -41,6 +41,11 @@
     if sys.platform == 'darwin':
         sys.argv = [a for a in sys.argv if not a.startswith('-psn_')]
 
+if os.environ.get('FLATPAK_ID') and os.environ.get('XDG_RUNTIME_DIR'):
+    # Set $TMPDIR to share files outside the sandbox
+    os.environ['TMPDIR'] = os.path.join(
+        os.environ.get('XDG_RUNTIME_DIR'), 'app', os.environ.get('FLATPAK_ID'))
+
 
 # Disable dbusmenu to show second menu in tabs
 os.environ['UBUNTU_MENUPROXY'] = '0'
diff -r f67a6be959d6 -r c719a04ecb31 tryton/client.py
--- a/tryton/client.py  Sat Apr 30 22:29:38 2022 +0200
+++ b/tryton/client.py  Mon May 02 10:22:20 2022 +0200
@@ -78,7 +78,7 @@
             'database': CONFIG['login.db'],
             }
         server = hashlib.md5(server.encode('utf-8')).hexdigest()
-        application_id = 'org.tryton._' + server
+        application_id = 'org.tryton.Tryton._' + server
         app = gui.Main(
             application_id=application_id,
             flags=Gio.ApplicationFlags.HANDLES_COMMAND_LINE)

Reply via email to