[mutter/wip/wayland-display] MonitorManager: fix the output DBus description



commit dfd4961b0df9826b738e2289ccdcd1aac8efd1b0
Author: Giovanni Campagna <gcampagn redhat com>
Date:   Thu Jul 25 15:18:25 2013 +0200

    MonitorManager: fix the output DBus description
    
    And at the same time add the preferred mode, which was forgotten.

 src/core/monitor.c |    7 ++++---
 src/xrandr.xml     |    3 ++-
 2 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/src/core/monitor.c b/src/core/monitor.c
index cdeff1f..caca448 100644
--- a/src/core/monitor.c
+++ b/src/core/monitor.c
@@ -1135,7 +1135,7 @@ meta_monitor_manager_handle_get_resources (MetaDBusDisplayConfig *skeleton,
   unsigned int i, j;
 
   g_variant_builder_init (&crtc_builder, G_VARIANT_TYPE ("a(uxiiiiiuaua{sv})"));
-  g_variant_builder_init (&output_builder, G_VARIANT_TYPE ("a(uxiaussssauauia{sv})"));
+  g_variant_builder_init (&output_builder, G_VARIANT_TYPE ("a(uxiaussssiuauaua{sv})"));
   g_variant_builder_init (&mode_builder, G_VARIANT_TYPE ("a(uxuud)"));
 
   for (i = 0; i < manager->n_crtcs; i++)
@@ -1187,7 +1187,7 @@ meta_monitor_manager_handle_get_resources (MetaDBusDisplayConfig *skeleton,
       g_variant_builder_add (&properties, "{sv}", "presentation",
                              g_variant_new_boolean (output->is_presentation));
 
-      g_variant_builder_add (&output_builder, "(uxiaussssauauiia{sv})",
+      g_variant_builder_add (&output_builder, "(uxiaussssiuauaua{sv})",
                              i, /* ID */
                              output->output_id,
                              (int)(output->crtc ? output->crtc - manager->crtcs : -1),
@@ -1196,9 +1196,10 @@ meta_monitor_manager_handle_get_resources (MetaDBusDisplayConfig *skeleton,
                              output->vendor,
                              output->product,
                              output->serial,
+                             output->backlight,
+                             (unsigned)(output->preferred_mode - manager->modes),
                              &modes,
                              &clones,
-                             output->backlight,
                              &properties);
     }
       
diff --git a/src/xrandr.xml b/src/xrandr.xml
index e63606e..c0e4ac8 100644
--- a/src/xrandr.xml
+++ b/src/xrandr.xml
@@ -81,6 +81,7 @@
        * s product: the human readable name of the display model
        * s serial: the serial number of this particular hardward part
        * i backlight: the backlight value as a percentage (-1 if not supported)
+       * u preferred_mode: API id of the preferred mode
        * au modes: valid modes for this output
        * au clones: valid clones for this output, ie other outputs that
                     can be assigned the same CRTC as this one; if you
@@ -126,7 +127,7 @@
     <method name="GetResources">
       <arg name="serial" direction="out" type="u" />
       <arg name="crtcs" direction="out" type="a(uxiiiiiuaua{sv})" />
-      <arg name="outputs" direction="out" type="a(uxiaussssauaua{sv})" />
+      <arg name="outputs" direction="out" type="a(uxiaussssiuauaua{sv})" />
       <arg name="modes" direction="out" type="a(uxuud)" />
       <arg name="max_screen_width" direction="out" type="i" />
       <arg name="max_screen_height" direction="out" type="i" />


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]