From 0abdad3eda35b8385d539288cd5f2466d66eb422 Mon Sep 17 00:00:00 2001
From: Simon McVittie <smcv@collabora.com>
Date: Tue, 11 Feb 2025 20:31:18 +0000
Subject: [PATCH] launch-options: Set DEBUG_INVOCATION=1 if extra debug is
 requested

systemd sets this variable for units with `RestartMode=debug`
if a previous attempt at starting the unit failed, and projects
like GLib and pressure-vessel are starting to use it as a
general-purpose opt-in to extra debug information. I suggested in
https://github.com/libsdl-org/SDL/issues/12275 that SDL could maybe do
the same.

Signed-off-by: Simon McVittie <smcv@collabora.com>
---
 bin/launch-options.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/bin/launch-options.py b/bin/launch-options.py
index 81fe529ba..da957b8c2 100755
--- a/bin/launch-options.py
+++ b/bin/launch-options.py
@@ -1870,8 +1870,9 @@ class Gui:
             environ['STEAM_COMPAT_RUNTIME_SDL3'] = value
 
         if self.debug_check.get_active():
-            environ['STEAM_LINUX_RUNTIME_VERBOSE'] = '1'
+            environ['DEBUG_INVOCATION'] = '1'
             environ['G_MESSAGES_DEBUG'] = 'all'
+            environ['STEAM_LINUX_RUNTIME_VERBOSE'] = '1'
 
         shell = self.shell_combo.get_active_id()
         terminal = self.terminal_combo.get_active_id()
-- 
GitLab