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:
@@ -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(
|
const DebugFlags = GObject.registerClass(
|
||||||
class DebugFlags extends St.BoxLayout {
|
class DebugFlags extends St.BoxLayout {
|
||||||
_init() {
|
_init() {
|
||||||
@@ -1251,9 +1270,12 @@ class DebugFlags extends St.BoxLayout {
|
|||||||
for (const flagName of this._getFlagNames(Meta.DebugTopic))
|
for (const flagName of this._getFlagNames(Meta.DebugTopic))
|
||||||
this.add_child(new MutterTopicDebugFlag(flagName));
|
this.add_child(new MutterTopicDebugFlag(flagName));
|
||||||
|
|
||||||
|
// General / Context
|
||||||
|
this._addHeader('General');
|
||||||
// MetaContext::unsafe-mode
|
// MetaContext::unsafe-mode
|
||||||
this._addHeader('MetaContext');
|
|
||||||
this.add_child(new UnsafeModeDebugFlag());
|
this.add_child(new UnsafeModeDebugFlag());
|
||||||
|
// DebugControl::exported
|
||||||
|
this.add_child(new DebugControlExportedDebugFlag());
|
||||||
}
|
}
|
||||||
|
|
||||||
_addHeader(title) {
|
_addHeader(title) {
|
||||||
|
Reference in New Issue
Block a user