Add debug controller

The debug controller can optionally, when passing --debug-control,
enable manipulating debug state, so far enabling/disabling HDR, via
D-Bus.

It's always created, in order to have a place to store debug state and
emit signals etc when it changes, but so far, it doesn't have its own
state it tracks, it just mirrors that of the monitor manager.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3432>
This commit is contained in:
Jonas Ådahl
2023-10-31 22:30:17 +08:00
committed by Marge Bot
parent d5253b1385
commit adc5489ba7
8 changed files with 383 additions and 1 deletions

View File

@ -72,6 +72,7 @@ typedef struct _MetaContextMainOptions
GList *virtual_monitor_infos;
#endif
char *trace_file;
gboolean debug_control;
} MetaContextMainOptions;
struct _MetaContextMain
@ -301,6 +302,13 @@ meta_context_main_configure (MetaContext *context,
meta_context_set_trace_file (context, context_main->options.trace_file);
#endif
if (context_main->options.debug_control)
{
MetaDebugControl *debug_control = meta_context_get_debug_control (context);
meta_debug_control_export (debug_control);
}
g_unsetenv ("DESKTOP_AUTOSTART_ID");
return TRUE;
@ -671,6 +679,11 @@ meta_context_main_add_option_entries (MetaContextMain *context_main)
N_("Profile performance using trace instrumentation"),
"FILE"
},
{
"debug-control", 0, 0, G_OPTION_ARG_NONE,
&context_main->options.debug_control,
N_("Enable debug control D-Bus interface")
},
{ NULL }
};