Support flatpak build

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

issue11250
review390051002
This commit is contained in:
Cédric Krier
2022-05-02 10:22:20 +02:00
parent 24ecab1560
commit a4c02f2fd6
2 changed files with 6 additions and 1 deletions
+5
View File
@@ -41,6 +41,11 @@ if hasattr(sys, 'frozen'):
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'
+1 -1
View File
@@ -78,7 +78,7 @@ def main():
'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)