[mutter] monitor-manager: Make scale floats in D-Bus API
- From: Jonas Ådahl <jadahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] monitor-manager: Make scale floats in D-Bus API
- Date: Fri, 7 Apr 2017 14:33:14 +0000 (UTC)
commit 3b46345db47ed266e040cc195fe7500d4a1eb777
Author: Jonas Ådahl <jadahl gmail com>
Date: Thu Jan 26 15:33:12 2017 +0800
monitor-manager: Make scale floats in D-Bus API
We don't want to limit ourself to whole integers for configuration, as
that'd mean it wouldn't be able to provide configurations for
fractional scalings. Thus, change scales to be referred to as floats
instead of ints.
https://bugzilla.gnome.org/show_bug.cgi?id=777732
src/backends/meta-monitor-manager.c | 8 ++++----
src/org.gnome.Mutter.DisplayConfig.xml | 8 ++++----
2 files changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/src/backends/meta-monitor-manager.c b/src/backends/meta-monitor-manager.c
index b8d9b4e..946233c 100644
--- a/src/backends/meta-monitor-manager.c
+++ b/src/backends/meta-monitor-manager.c
@@ -1177,14 +1177,14 @@ meta_monitor_manager_legacy_handle_apply_configuration (MetaDBusDisplayConfig *
#define META_DISPLAY_CONFIG_MODE_FLAGS_PREFERRED (1 << 0)
#define META_DISPLAY_CONFIG_MODE_FLAGS_CURRENT (1 << 1)
-#define MODE_FORMAT "(iidiu)"
+#define MODE_FORMAT "(iiddu)"
#define MODES_FORMAT "a" MODE_FORMAT
#define MONITOR_SPEC_FORMAT "(ssss)"
#define MONITOR_FORMAT "(" MONITOR_SPEC_FORMAT MODES_FORMAT "a{sv})"
#define MONITORS_FORMAT "a" MONITOR_FORMAT
#define LOGICAL_MONITOR_MONITORS_FORMAT "a" MONITOR_SPEC_FORMAT
-#define LOGICAL_MONITOR_FORMAT "(iiii" LOGICAL_MONITOR_MONITORS_FORMAT "iba{sv})"
+#define LOGICAL_MONITOR_FORMAT "(iiii" LOGICAL_MONITOR_MONITORS_FORMAT "dba{sv})"
#define LOGICAL_MONITORS_FORMAT "a" LOGICAL_MONITOR_FORMAT
static gboolean
@@ -1237,7 +1237,7 @@ meta_monitor_manager_handle_get_current_state (MetaDBusDisplayConfig *skeleton,
monitor_mode_spec->width,
monitor_mode_spec->height,
monitor_mode_spec->refresh_rate,
- preferred_scale,
+ (double) preferred_scale,
flags);
}
@@ -1289,7 +1289,7 @@ meta_monitor_manager_handle_get_current_state (MetaDBusDisplayConfig *skeleton,
logical_monitor->rect.width,
logical_monitor->rect.height,
&logical_monitor_monitors_builder,
- logical_monitor->scale,
+ (double) logical_monitor->scale,
logical_monitor->is_primary,
NULL);
}
diff --git a/src/org.gnome.Mutter.DisplayConfig.xml b/src/org.gnome.Mutter.DisplayConfig.xml
index 9efe535..22cb017 100644
--- a/src/org.gnome.Mutter.DisplayConfig.xml
+++ b/src/org.gnome.Mutter.DisplayConfig.xml
@@ -308,7 +308,7 @@
* i width: width in physical pixels
* i height: height in physical pixels
* d refresh rate: refresh rate
- * i preferred scale: scale preferred as per calculations
+ * d preferred scale: scale preferred as per calculations
* u flags: mode flags (see below)
* a{sv} properties: optional properties, including:
- "width_mm" (i): physical width of monitor in millimeters
@@ -333,7 +333,7 @@
* vendor: vendor name
* product: product name
* serial: product serial
- * i scale: scale
+ * d scale: scale
* b primary: true if this is the primary logical monitor
* a{sv} properties: possibly other properties
@@ -343,8 +343,8 @@
-->
<method name="GetCurrentState">
<arg name="serial" direction="out" type="u" />
- <arg name="monitors" direction="out" type="a((ssss)a(iidiu)a{sv})" />
- <arg name="logical_monitors" direction="out" type="a(iiiia(ssss)iba{sv})" />
+ <arg name="monitors" direction="out" type="a((ssss)a(iiddu)a{sv})" />
+ <arg name="logical_monitors" direction="out" type="a(iiiia(ssss)dba{sv})" />
<arg name="max_screen_size" direction="out" type="(ii)" />
</method>
</interface>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]