[mutter] monitor-store: Support configuring logical monitor scale
- From: Jonas Ådahl <jadahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] monitor-store: Support configuring logical monitor scale
- Date: Fri, 7 Apr 2017 14:32:38 +0000 (UTC)
commit ee32ca3efe7403179bd741238675bfacf086e054
Author: Jonas Ådahl <jadahl gmail com>
Date: Thu Jan 19 17:26:52 2017 +0800
monitor-store: Support configuring logical monitor scale
Add support to configure the logical monitor scale. With this, it
becomes possible to override the automatically calculated scaling
number per logical monitor.
https://bugzilla.gnome.org/show_bug.cgi?id=777732
src/backends/meta-monitor-config-store.c | 28 +++++++++++++++++++++++++++-
1 files changed, 27 insertions(+), 1 deletions(-)
---
diff --git a/src/backends/meta-monitor-config-store.c b/src/backends/meta-monitor-config-store.c
index c290d2d..4ce8dbb 100644
--- a/src/backends/meta-monitor-config-store.c
+++ b/src/backends/meta-monitor-config-store.c
@@ -37,6 +37,7 @@
* <logicalmonitor>
* <x>0</x>
* <y>0</y>
+ * <scale>1</scale>
* <monitor>
* <monitorspec>
* <connector>LVDS1</connector>
@@ -94,6 +95,7 @@ typedef enum
STATE_LOGICAL_MONITOR_Y,
STATE_LOGICAL_MONITOR_PRIMARY,
STATE_LOGICAL_MONITOR_PRESENTATION,
+ STATE_LOGICAL_MONITOR_SCALE,
STATE_MONITOR,
STATE_MONITOR_SPEC,
STATE_MONITOR_SPEC_CONNECTOR,
@@ -206,6 +208,10 @@ handle_start_element (GMarkupParseContext *context,
{
parser->state = STATE_LOGICAL_MONITOR_Y;
}
+ else if (g_str_equal (element_name, "scale"))
+ {
+ parser->state = STATE_LOGICAL_MONITOR_SCALE;
+ }
else if (g_str_equal (element_name, "primary"))
{
parser->state = STATE_LOGICAL_MONITOR_PRIMARY;
@@ -232,6 +238,7 @@ handle_start_element (GMarkupParseContext *context,
case STATE_LOGICAL_MONITOR_X:
case STATE_LOGICAL_MONITOR_Y:
+ case STATE_LOGICAL_MONITOR_SCALE:
case STATE_LOGICAL_MONITOR_PRIMARY:
case STATE_LOGICAL_MONITOR_PRESENTATION:
{
@@ -533,6 +540,7 @@ handle_end_element (GMarkupParseContext *context,
{
case STATE_LOGICAL_MONITOR_X:
case STATE_LOGICAL_MONITOR_Y:
+ case STATE_LOGICAL_MONITOR_SCALE:
case STATE_LOGICAL_MONITOR_PRIMARY:
case STATE_LOGICAL_MONITOR_PRESENTATION:
{
@@ -622,7 +630,8 @@ handle_end_element (GMarkupParseContext *context,
g_assert (g_str_equal (element_name, "logicalmonitor"));
- logical_monitor_config->scale = 1;
+ if (logical_monitor_config->scale == 0)
+ logical_monitor_config->scale = 1;
if (!verify_logical_monitor_config (logical_monitor_config, error))
return;
@@ -834,6 +843,23 @@ handle_text (GMarkupParseContext *context,
return;
}
+ case STATE_LOGICAL_MONITOR_SCALE:
+ {
+ if (!read_int (text, text_len,
+ &parser->current_logical_monitor_config->scale, error))
+ return;
+
+ if (parser->current_logical_monitor_config->scale <= 0)
+ {
+ g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
+ "Logical monitor scale '%d' invalid",
+ parser->current_logical_monitor_config->scale);
+ return;
+ }
+
+ return;
+ }
+
case STATE_LOGICAL_MONITOR_PRIMARY:
{
read_bool (text, text_len,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]