From 3b46345db47ed266e040cc195fe7500d4a1eb777 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Thu, 26 Jan 2017 15:33:12 +0800 Subject: [PATCH] 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 b8d9b4e98..946233cd1 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 9efe535de..22cb017f4 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 @@ --> - - + +