mutter/patches/sessionMode-add-support-for-debugFlags-parameter.patch
Ward Nakchbandi (Cosmic Fusion) deaf92469b
2023-10-03 21:58:03 +03:00

47 lines
1.5 KiB
Diff

From: =?utf-8?b?Ik1hcmNvIFRyZXZpc2FuIChUcmV2acOxbyki?= <mail@3v1n0.net>
Date: Thu, 2 Aug 2018 16:05:13 +0200
Subject: sessionMode: add support for `debugFlags` parameter
A session can now define `debugFlags` from a json file, still leaving priority
to the environment variable.
https://bugzilla.gnome.org/show_bug.cgi?id=789377
Bug-GNOME: https://bugzilla.gnome.org/show_bug.cgi?id=789377
Forwarded: https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/6
---
js/ui/main.js | 7 +++++++
js/ui/sessionMode.js | 1 +
2 files changed, 8 insertions(+)
diff --git a/js/ui/main.js b/js/ui/main.js
index 6240b12..b3fff22 100644
--- a/js/ui/main.js
+++ b/js/ui/main.js
@@ -136,6 +136,13 @@ function _sessionUpdated() {
_remoteAccessInhibited = true;
}
}
+
+ if (!GLib.getenv('SHELL_DEBUG')) {
+ if (typeof sessionMode.debugFlags === 'string')
+ global.set_debug_flags(sessionMode.debugFlags);
+ else if (Array.isArray(sessionMode.debugFlags))
+ global.set_debug_flags(sessionMode.debugFlags.join(':'))
+ }
}
/** @returns {void} */
diff --git a/js/ui/sessionMode.js b/js/ui/sessionMode.js
index e27f4fa..45320ea 100644
--- a/js/ui/sessionMode.js
+++ b/js/ui/sessionMode.js
@@ -32,6 +32,7 @@ const _modes = {
showWelcomeDialog: false,
allowSettings: false,
allowScreencast: false,
+ debugFlags: [],
enabledExtensions: [],
hasRunDialog: false,
hasWorkspaces: false,