lookingGlass: Make it possible to export the DebugControl service

Mutter has a new tool for interacting with mutter with features we don't
expose to users yet. It can be exported as a dbus service but it is not
done so by default. This adds an easy way to do so without having to
remember some JS snippet.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3425>
This commit is contained in:
Sebastian Wick
2024-07-24 22:33:59 +02:00
parent de577c1f87
commit a65e0722f1

View File

@ -1222,6 +1222,25 @@ class UnsafeModeDebugFlag extends DebugFlag {
}
});
const DebugControlExportedDebugFlag = GObject.registerClass(
class DebugControlExportedDebugFlag extends DebugFlag {
_init() {
super._init('debug-control');
}
_isEnabled() {
return global.context.get_debug_control().exported;
}
_enable() {
global.context.get_debug_control().exported = true;
}
_disable() {
global.context.get_debug_control().exported = false;
}
});
const DebugFlags = GObject.registerClass(
class DebugFlags extends St.BoxLayout {
_init() {
@ -1251,9 +1270,12 @@ class DebugFlags extends St.BoxLayout {
for (const flagName of this._getFlagNames(Meta.DebugTopic))
this.add_child(new MutterTopicDebugFlag(flagName));
// General / Context
this._addHeader('General');
// MetaContext::unsafe-mode
this._addHeader('MetaContext');
this.add_child(new UnsafeModeDebugFlag());
// DebugControl::exported
this.add_child(new DebugControlExportedDebugFlag());
}
_addHeader(title) {