From 5ca2e06b2c8b1a9d2c45663bb1dce68567806930 Mon Sep 17 00:00:00 2001 From: Sebastian Wick Date: Mon, 29 Jan 2024 22:27:15 +0100 Subject: [PATCH] monitor-config-store: Explicitly initialize MonitorConfig To the defaults. This will become useful in the next commit where we want a default value that's not 0. Part-of: --- src/backends/meta-monitor-config-store.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/backends/meta-monitor-config-store.c b/src/backends/meta-monitor-config-store.c index 53a32cd2a..48da80371 100644 --- a/src/backends/meta-monitor-config-store.c +++ b/src/backends/meta-monitor-config-store.c @@ -210,6 +210,14 @@ typedef struct G_DEFINE_TYPE (MetaMonitorConfigStore, meta_monitor_config_store, G_TYPE_OBJECT) +static void +meta_monitor_config_init (MetaMonitorConfig *config) +{ + config->enable_underscanning = FALSE; + config->has_max_bpc = FALSE; + config->max_bpc = 0; +} + static gboolean text_equals (const char *text, int len, @@ -387,6 +395,7 @@ handle_start_element (GMarkupParseContext *context, else if (g_str_equal (element_name, "monitor")) { parser->current_monitor_config = g_new0 (MetaMonitorConfig, 1); + meta_monitor_config_init (parser->current_monitor_config); parser->state = STATE_MONITOR; }