From e357b4a46a5d33df1135a37fae58956a02223184 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Tue, 17 Jan 2017 11:31:29 +0800 Subject: [PATCH] monitor-store: Add support for monitor underscanning Add a subelement for configuring output underscanning. https://bugzilla.gnome.org/show_bug.cgi?id=777732 --- src/backends/meta-monitor-config-store.c | 29 ++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/src/backends/meta-monitor-config-store.c b/src/backends/meta-monitor-config-store.c index eaf70f299..18828c05f 100644 --- a/src/backends/meta-monitor-config-store.c +++ b/src/backends/meta-monitor-config-store.c @@ -68,6 +68,7 @@ * 1080 * 60.049972534179688 * + * yes * * yes * @@ -103,6 +104,7 @@ typedef enum STATE_MONITOR_MODE_WIDTH, STATE_MONITOR_MODE_HEIGHT, STATE_MONITOR_MODE_RATE, + STATE_MONITOR_UNDERSCANNING } ParserState; typedef struct @@ -252,6 +254,10 @@ handle_start_element (GMarkupParseContext *context, parser->state = STATE_MONITOR_MODE; } + else if (g_str_equal (element_name, "underscanning")) + { + parser->state = STATE_MONITOR_UNDERSCANNING; + } else { g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_UNKNOWN_ELEMENT, @@ -332,6 +338,13 @@ handle_start_element (GMarkupParseContext *context, "Invalid mode sub element '%s'", element_name); return; } + + case STATE_MONITOR_UNDERSCANNING: + { + g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_UNKNOWN_ELEMENT, + "Invalid element '%s' under underscanning", element_name); + return; + } } } @@ -566,6 +579,14 @@ handle_end_element (GMarkupParseContext *context, return; } + case STATE_MONITOR_UNDERSCANNING: + { + g_assert (g_str_equal (element_name, "underscanning")); + + parser->state = STATE_MONITOR; + return; + } + case STATE_MONITOR: { MetaLogicalMonitorConfig *logical_monitor_config; @@ -842,6 +863,14 @@ handle_text (GMarkupParseContext *context, error); return; } + + case STATE_MONITOR_UNDERSCANNING: + { + read_bool (text, text_len, + &parser->current_monitor_config->is_underscanning, + error); + return; + } } }