Commit 632dffb7 authored by Giovanni Campagna's avatar Giovanni Campagna Committed by Giovanni Campagna

API: GnomeRR: replace direct XRandR calls with DBus calls to mutter

Mutter now provides a DBus API that wraps XRandR and abstracts
away the detail of running X or wayland.

A number of API changes are needed, as GnomeRR is no longer in
charge of maintaining the monitors.xml file updated.

https://bugzilla.gnome.org/show_bug.cgi?id=705510
parent 5e66ef06
......@@ -29,7 +29,6 @@ introspection_sources = \
gnome-bg.c \
gnome-bg-slide-show.c \
gnome-bg-crossfade.c \
display-name.c \
gnome-rr.c \
gnome-rr-config.c \
gnome-rr-output-info.c \
......@@ -42,12 +41,25 @@ introspection_sources = \
libgnome_desktop_3_la_SOURCES = \
$(introspection_sources) \
$(dbus_xrandr_built_sources) \
gnome-datetime-source.h \
gnome-datetime-source.c \
gnome-rr-private.h \
default-input-sources.h \
edid.h \
locarchive.h
locarchive.h \
meta-xrandr-shared.h
dbus_xrandr_built_sources = meta-dbus-xrandr.c meta-dbus-xrandr.h
$(dbus_xrandr_built_sources) : Makefile.am xrandr.xml
$(AM_V_GEN)gdbus-codegen \
--interface-prefix org.gnome.Mutter \
--c-namespace MetaDBus \
--generate-c-code meta-dbus-xrandr \
xrandr.xml
BUILT_SOURCES = $(dbus_xrandr_built_sources)
libgnome_desktop_3_la_LIBADD = \
$(XLIB_LIBS) \
......
/*
* Copyright 2007 Red Hat, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* on the rights to use, copy, modify, merge, publish, distribute, sub
* license, and/or sell copies of the Software, and to permit persons to whom
* the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/* Author: Soren Sandmann <sandmann@redhat.com> */
#include <config.h>
#include <glib/gi18n-lib.h>
#include <stdlib.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <glib.h>
#include "gnome-pnp-ids.h"
#include "edid.h"
static const char *
find_vendor (const char *code)
{
const char *vendor_name;
GnomePnpIds *pnp_ids;
pnp_ids = gnome_pnp_ids_new ();
vendor_name = gnome_pnp_ids_get_pnp_id (pnp_ids, code);
g_object_unref (pnp_ids);
if (vendor_name)
return vendor_name;
return code;
}
static const double known_diagonals[] = {
12.1,
13.3,
15.6
};
static char *
diagonal_to_str (double d)
{
int i;
for (i = 0; i < G_N_ELEMENTS (known_diagonals); i++)
{
double delta;
delta = fabs(known_diagonals[i] - d);
if (delta < 0.1)
return g_strdup_printf ("%0.1lf\"", known_diagonals[i]);
}
return g_strdup_printf ("%d\"", (int) (d + 0.5));
}
char *
make_display_size_string (int width_mm,
int height_mm)
{
char *inches = NULL;
if (width_mm > 0 && height_mm > 0)
{
double d = sqrt (width_mm * width_mm + height_mm * height_mm);
inches = diagonal_to_str (d / 25.4);
}
return inches;
}
char *
make_display_name (const MonitorInfo *info)
{
const char *vendor;
int width_mm, height_mm;
char *inches, *ret;
if (info)
{
vendor = find_vendor (info->manufacturer_code);
}
else
{
/* Translators: "Unknown" here is used to identify a monitor for which
* we don't know the vendor. When a vendor is known, the name of the
* vendor is used. */
vendor = C_("Monitor vendor", "Unknown");
}
if (info && info->width_mm != -1 && info->height_mm)
{
width_mm = info->width_mm;
height_mm = info->height_mm;
}
else if (info && info->n_detailed_timings)
{
width_mm = info->detailed_timings[0].width_mm;
height_mm = info->detailed_timings[0].height_mm;
}
else
{
width_mm = -1;
height_mm = -1;
}
if (width_mm != -1 && height_mm != -1)
{
double d = sqrt (width_mm * width_mm + height_mm * height_mm);
inches = diagonal_to_str (d / 25.4);
}
else
{
inches = NULL;
}
if (!inches)
return g_strdup (vendor);
ret = g_strdup_printf ("%s %s", vendor, inches);
g_free (inches);
return ret;
}
......@@ -189,7 +189,5 @@ struct MonitorInfo
};
MonitorInfo *decode_edid (const uchar *data);
char *make_display_name (const MonitorInfo *info);
char *make_display_size_string (int width_mm, int height_mm);
#endif
This diff is collapsed.
......@@ -75,9 +75,9 @@ GnomeRRRotation gnome_rr_output_info_get_rotation (GnomeRROutputInfo *self);
void gnome_rr_output_info_set_rotation (GnomeRROutputInfo *self, GnomeRRRotation rotation);
gboolean gnome_rr_output_info_is_connected (GnomeRROutputInfo *self);
void gnome_rr_output_info_get_vendor (GnomeRROutputInfo *self, gchar* vendor);
guint gnome_rr_output_info_get_product (GnomeRROutputInfo *self);
guint gnome_rr_output_info_get_serial (GnomeRROutputInfo *self);
const char *gnome_rr_output_info_get_vendor (GnomeRROutputInfo *self);
const char *gnome_rr_output_info_get_product (GnomeRROutputInfo *self);
const char *gnome_rr_output_info_get_serial (GnomeRROutputInfo *self);
double gnome_rr_output_info_get_aspect_ratio (GnomeRROutputInfo *self);
char *gnome_rr_output_info_get_display_name (GnomeRROutputInfo *self);
......@@ -115,31 +115,21 @@ GType gnome_rr_config_get_type (void);
GnomeRRConfig *gnome_rr_config_new_current (GnomeRRScreen *screen,
GError **error);
GnomeRRConfig *gnome_rr_config_new_stored (GnomeRRScreen *screen,
gboolean gnome_rr_config_load_current (GnomeRRConfig *self,
GError **error);
gboolean gnome_rr_config_load_current (GnomeRRConfig *self,
GError **error);
gboolean gnome_rr_config_load_filename (GnomeRRConfig *self,
const gchar *filename,
GError **error);
gboolean gnome_rr_config_match (GnomeRRConfig *config1,
GnomeRRConfig *config2);
gboolean gnome_rr_config_equal (GnomeRRConfig *config1,
GnomeRRConfig *config2);
gboolean gnome_rr_config_save (GnomeRRConfig *configuration,
GError **error);
void gnome_rr_config_sanitize (GnomeRRConfig *configuration);
gboolean gnome_rr_config_ensure_primary (GnomeRRConfig *configuration);
gboolean gnome_rr_config_apply_with_time (GnomeRRConfig *configuration,
GnomeRRScreen *screen,
guint32 timestamp,
GError **error);
gboolean gnome_rr_config_apply_from_filename_with_time (GnomeRRScreen *screen,
const char *filename,
guint32 timestamp,
GError **error);
gboolean gnome_rr_config_apply (GnomeRRConfig *configuration,
GnomeRRScreen *screen,
GError **error);
gboolean gnome_rr_config_apply_persistent (GnomeRRConfig *configuration,
GnomeRRScreen *screen,
GError **error);
gboolean gnome_rr_config_applicable (GnomeRRConfig *configuration,
GnomeRRScreen *screen,
......@@ -149,7 +139,4 @@ gboolean gnome_rr_config_get_clone (GnomeRRConfig *configuration)
void gnome_rr_config_set_clone (GnomeRRConfig *configuration, gboolean clone);
GnomeRROutputInfo **gnome_rr_config_get_outputs (GnomeRRConfig *configuration);
char *gnome_rr_config_get_backup_filename (void);
char *gnome_rr_config_get_intended_filename (void);
#endif
......@@ -83,7 +83,7 @@ main (int argc, char *argv[])
outputs = gnome_rr_screen_list_outputs (screen);
for (i = 0; outputs[i] != NULL; i++) {
g_print ("[%s]\n", gnome_rr_output_get_name (outputs[i]));
g_print ("\tconnected: %i\n", gnome_rr_output_is_connected (outputs[i]));
g_print ("\tconnected: %i\n", 1);
g_print ("\tbuilt-in: %i\n", gnome_rr_output_is_builtin_display (outputs[i]));
g_print ("\tprimary: %i\n", gnome_rr_output_get_is_primary (outputs[i]));
g_print ("\tid: %i\n", gnome_rr_output_get_id (outputs[i]));
......
......@@ -169,29 +169,27 @@ gboolean gnome_rr_output_info_is_connected (GnomeRROutputInfo *self)
/**
* gnome_rr_output_info_get_vendor:
* @self: a #GnomeRROutputInfo
* @vendor: (out caller-allocates) (array fixed-size=4):
*/
void gnome_rr_output_info_get_vendor (GnomeRROutputInfo *self, gchar* vendor)
const char *
gnome_rr_output_info_get_vendor (GnomeRROutputInfo *self)
{
g_return_if_fail (GNOME_IS_RR_OUTPUT_INFO (self));
g_return_if_fail (vendor != NULL);
g_return_val_if_fail (GNOME_IS_RR_OUTPUT_INFO (self), NULL);
vendor[0] = self->priv->vendor[0];
vendor[1] = self->priv->vendor[1];
vendor[2] = self->priv->vendor[2];
vendor[3] = self->priv->vendor[3];
return self->priv->vendor;
}
guint gnome_rr_output_info_get_product (GnomeRROutputInfo *self)
const char *
gnome_rr_output_info_get_product (GnomeRROutputInfo *self)
{
g_return_val_if_fail (GNOME_IS_RR_OUTPUT_INFO (self), 0);
g_return_val_if_fail (GNOME_IS_RR_OUTPUT_INFO (self), NULL);
return self->priv->product;
}
guint gnome_rr_output_info_get_serial (GnomeRROutputInfo *self)
const char *
gnome_rr_output_info_get_serial (GnomeRROutputInfo *self)
{
g_return_val_if_fail (GNOME_IS_RR_OUTPUT_INFO (self), 0);
g_return_val_if_fail (GNOME_IS_RR_OUTPUT_INFO (self), NULL);
return self->priv->serial;
}
......
#ifndef GNOME_RR_PRIVATE_H
#define GNOME_RR_PRIVATE_H
#include <X11/Xlib.h>
#ifdef GDK_WINDOWING_WAYLAND
#include <gdk/gdkwayland.h>
#else
enum wl_output_transform {
WL_OUTPUT_TRANSFORM_NORMAL,
WL_OUTPUT_TRANSFORM_90,
WL_OUTPUT_TRANSFORM_180,
WL_OUTPUT_TRANSFORM_270,
WL_OUTPUT_TRANSFORM_FLIPPED,
WL_OUTPUT_TRANSFORM_FLIPPED_90,
WL_OUTPUT_TRANSFORM_FLIPPED_180,
WL_OUTPUT_TRANSFORM_FLIPPED_270
};
#endif
#include <X11/extensions/Xrandr.h>
#include "meta-xrandr-shared.h"
#include "meta-dbus-xrandr.h"
typedef struct ScreenInfo ScreenInfo;
......@@ -14,7 +28,7 @@ struct ScreenInfo
int min_height;
int max_height;
XRRScreenResources *resources;
guint serial;
GnomeRROutput ** outputs;
GnomeRRCrtc ** crtcs;
......@@ -24,24 +38,16 @@ struct ScreenInfo
GnomeRRMode ** clone_modes;
RROutput primary;
GnomeRROutput * primary;
};
struct GnomeRRScreenPrivate
{
GdkScreen * gdk_screen;
GdkWindow * gdk_root;
Display * xdisplay;
Screen * xscreen;
Window xroot;
ScreenInfo * info;
int randr_event_base;
int rr_major_version;
int rr_minor_version;
Atom connector_type_atom;
gboolean dpms_capable;
MetaDBusDisplayConfig *proxy;
};
struct _GnomeRROutputInfoPrivate
......@@ -57,9 +63,9 @@ struct _GnomeRROutputInfoPrivate
GnomeRRRotation rotation;
gboolean connected;
gchar vendor[4];
guint product;
guint serial;
char * vendor;
char * product;
char * serial;
double aspect;
int pref_width;
int pref_height;
......@@ -76,4 +82,10 @@ struct _GnomeRRConfigPrivate
gboolean _gnome_rr_output_name_is_builtin_display (const char *name);
gboolean _gnome_rr_screen_apply_configuration (GnomeRRScreen *screen,
gboolean persistent,
GVariant *crtcs,
GVariant *outputs,
GError **error);
#endif
This diff is collapsed.
......@@ -111,11 +111,6 @@ GnomeRROutput **gnome_rr_screen_list_outputs (GnomeRRScreen *scree
GnomeRRCrtc ** gnome_rr_screen_list_crtcs (GnomeRRScreen *screen);
GnomeRRMode ** gnome_rr_screen_list_modes (GnomeRRScreen *screen);
GnomeRRMode ** gnome_rr_screen_list_clone_modes (GnomeRRScreen *screen);
void gnome_rr_screen_set_size (GnomeRRScreen *screen,
int width,
int height,
int mm_width,
int mm_height);
GnomeRRCrtc * gnome_rr_screen_get_crtc_by_id (GnomeRRScreen *screen,
guint32 id);
gboolean gnome_rr_screen_refresh (GnomeRRScreen *screen,
......@@ -129,12 +124,6 @@ void gnome_rr_screen_get_ranges (GnomeRRScreen *scree
int *max_width,
int *min_height,
int *max_height);
void gnome_rr_screen_get_timestamps (GnomeRRScreen *screen,
guint32 *change_timestamp_ret,
guint32 *config_timestamp_ret);
void gnome_rr_screen_set_primary_output (GnomeRRScreen *screen,
GnomeRROutput *output);
GnomeRRMode **gnome_rr_screen_create_clone_modes (GnomeRRScreen *screen);
......@@ -149,21 +138,12 @@ gboolean gnome_rr_screen_set_dpms_mode (GnomeRRScreen *scree
guint32 gnome_rr_output_get_id (GnomeRROutput *output);
const char * gnome_rr_output_get_name (GnomeRROutput *output);
const char * gnome_rr_output_get_display_name (GnomeRROutput *output);
gboolean gnome_rr_output_is_connected (GnomeRROutput *output);
int gnome_rr_output_get_size_inches (GnomeRROutput *output);
int gnome_rr_output_get_width_mm (GnomeRROutput *outout);
int gnome_rr_output_get_height_mm (GnomeRROutput *output);
const guint8 * gnome_rr_output_get_edid_data (GnomeRROutput *output,
gsize *size);
gboolean gnome_rr_output_get_ids_from_edid (GnomeRROutput *output,
void gnome_rr_output_get_ids_from_edid (GnomeRROutput *output,
char **vendor,
int *product,
int *serial);
char **product,
char **serial);
gint gnome_rr_output_get_backlight_min (GnomeRROutput *output);
gint gnome_rr_output_get_backlight_max (GnomeRROutput *output);
gint gnome_rr_output_get_backlight (GnomeRROutput *output,
GError **error);
gint gnome_rr_output_get_backlight (GnomeRROutput *output);
gboolean gnome_rr_output_set_backlight (GnomeRROutput *output,
gint value,
GError **error);
......@@ -171,7 +151,6 @@ gboolean gnome_rr_output_set_backlight (GnomeRROutput *outpu
GnomeRRCrtc ** gnome_rr_output_get_possible_crtcs (GnomeRROutput *output);
GnomeRRMode * gnome_rr_output_get_current_mode (GnomeRROutput *output);
GnomeRRCrtc * gnome_rr_output_get_crtc (GnomeRROutput *output);
const char * gnome_rr_output_get_connector_type (GnomeRROutput *output);
gboolean gnome_rr_output_is_builtin_display (GnomeRROutput *output);
void gnome_rr_output_get_position (GnomeRROutput *output,
int *x,
......@@ -193,15 +172,6 @@ int gnome_rr_mode_get_freq (GnomeRRMode *mode)
/* GnomeRRCrtc */
guint32 gnome_rr_crtc_get_id (GnomeRRCrtc *crtc);
gboolean gnome_rr_crtc_set_config_with_time (GnomeRRCrtc *crtc,
guint32 timestamp,
int x,
int y,
GnomeRRMode *mode,
GnomeRRRotation rotation,
GnomeRROutput **outputs,
int n_outputs,
GError **error);
gboolean gnome_rr_crtc_can_drive_output (GnomeRRCrtc *crtc,
GnomeRROutput *output);
GnomeRRMode * gnome_rr_crtc_get_current_mode (GnomeRRCrtc *crtc);
......@@ -213,6 +183,7 @@ GnomeRRRotation gnome_rr_crtc_get_rotations (GnomeRRCrtc *crtc)
gboolean gnome_rr_crtc_supports_rotation (GnomeRRCrtc *crtc,
GnomeRRRotation rotation);
#if 0 /* gamma support */
gboolean gnome_rr_crtc_get_gamma (GnomeRRCrtc *crtc,
int *size,
unsigned short **red,
......@@ -223,4 +194,6 @@ void gnome_rr_crtc_set_gamma (GnomeRRCrtc *crtc,
unsigned short *red,
unsigned short *green,
unsigned short *blue);
#endif
#endif /* GNOME_RR_H */
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
/*
* Copyright (C) 2013 Red Hat Inc.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*/
/* This file is shared between mutter (src/core/meta-xrandr-shared.h)
and gnome-desktop (libgnome-desktop/meta-xrandr-shared.h).
The canonical place for all changes is mutter.
There should be no includes in this file.
*/
#ifndef META_XRANDR_SHARED_H
#define META_XRANDR_SHARED_H
typedef enum {
META_POWER_SAVE_UNKNOWN = -1,
META_POWER_SAVE_ON = 0,
META_POWER_SAVE_STANDBY,
META_POWER_SAVE_SUSPEND,
META_POWER_SAVE_OFF,
} MetaPowerSave;
#define META_OUTPUT_STRUCT "(uxiausauau@a{sv})"
#define META_CRTC_STRUCT "(uxiiiiiuau@a{sv})"
#define META_MONITOR_MODE_STRUCT "(uxuud)"
#endif
<!DOCTYPE node PUBLIC
'-//freedesktop//DTD D-BUS Object Introspection 1.0//EN'
'http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd'>
<node>
<!--
org.gnome.Mutter.DisplayConfig:
@short_description: display configuration interface
This interface is used by mutter and gnome-settings-daemon
to apply multiple monitor configuration.
-->
<interface name="org.gnome.Mutter.DisplayConfig">
<!--
GetResources:
@serial: configuration serial
@crtcs: available CRTCs
@outputs: available outputs
@modes: available modes
@max_screen_width:
@max_screen_height:
Retrieves the current layout of the hardware.
@serial is an unique identifier representing the current state
of the screen. It must be passed back to ApplyConfiguration()
and will be increased for every configuration change (so that
mutter can detect that the new configuration is based on old
state).
A CRTC (CRT controller) is a logical monitor, ie a portion
of the compositor coordinate space. It might correspond
to multiple monitors, when in clone mode, but not that
it is possible to implement clone mode also by setting different
CRTCs to the same coordinates.
The number of CRTCs represent the maximum number of monitors
that can be set to expand and it is a HW constraint; if more
monitors are connected, then necessarily some will clone. This
is complementary to the concept of the encoder (not exposed in
the API), which groups outputs that necessarily will show the
same image (again a HW constraint).
A CRTC is represented by a DBus structure with the following
layout:
* u ID: the ID in the API of this CRTC
* x winsys_id: the low-level ID of this CRTC (which might
be a XID, a KMS handle or something entirely
different)
* i x, y, width, height: the geometry of this CRTC
(might be invalid if the CRTC is not in
use)
* i current_mode: the current mode of the CRTC, or -1 if this
CRTC is not used
Note: the size of the mode will always correspond
to the width and height of the CRTC
* u current_transform: the current transform (espressed according
to the wayland protocol)
* au transforms: all possible transforms
* a{sv} properties: other high-level properties that affect this
CRTC; they are not necessarily reflected in
the hardware.
No property is specified in this version of the API.
Note: all geometry information refers to the untransformed
display.
An output represents a physical screen, connected somewhere to
the computer. Floating connectors are not exposed in the API.
An output is a DBus struct with the following fields:
* u ID: the ID in the API
* x winsys_id: the low-level ID of this output (XID or KMS handle)
* i current_crtc: the CRTC that is currently driving this output,
or -1 if the output is disabled
* au possible_crtcs: all CRTCs that can control this output
* s name: the name of the connector to which the output is attached
(like VGA1 or HDMI)
* 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
want to mirror two outputs that don't have each other
in the clone list, you must configure two different
CRTCs for the same geometry
* a{sv} properties: other high-level properties that affect this
output; they are not necessarily reflected in
the hardware.
Known properties:
- "vendor" (s): (readonly) the human readable name
of the manufacturer
- "product" (s): (readonly) the human readable name
of the display model
- "serial" (s): (readonly) the serial number of this
particular hardware part
- "display-name" (s): (readonly) a human readable name
of this output, to be shown in the UI
- "backlight" (i): (readonly, use the specific interface)
the backlight value as a percentage
(-1 if not supported)
- "primary" (b): whether this output is primary
or not
- "presentation" (b): whether this output is
for presentation only
Note: properties might be ignored if not consistenly
applied to all outputs in the same clone group. In
general, it's expected that presentation or primary
outputs will not be cloned.
A mode represents a set of parameters that are applied to
each output, such as resolution and refresh rate. It is a separate
object so that it can be referenced by CRTCs and outputs.
Multiple outputs in the same CRTCs must all have the same mode.
A mode is exposed as:
* u ID: the ID in the API
* x winsys_id: the low-level ID of this mode
* u width, height: the resolution
* d frequency: refresh rate
Output and modes are read-only objects (except for output properties),
they can change only in accordance to HW changes (such as hotplugging
a monitor), while CRTCs can be changed with ApplyConfiguration().
XXX: actually, if you insist enough, you can add new modes
through xrandr command line or the KMS API, overriding what the
kernel driver and the EDID say.
Usually, it only matters with old cards with broken drivers, or
old monitors with broken EDIDs, but it happens more often with
projectors (if for example the kernel driver doesn't add the
640x480 - 800x600 - 1024x768 default modes). Probably something
that we need to handle in mutter anyway.
-->
<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(uxiausauaua{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" />
</method>
<!--
ApplyConfiguration:
@serial: configuration serial
@persistent: whether this configuration should be saved on disk
@crtcs: new data for CRTCs
@outputs: new data for outputs
Applies the requested configuration changes.
@serial must match the serial from the last GetResources() call,
or org.freedesktop.DBus.AccessDenied will be generated.
(XXX: a better error maybe?)
If @persistent is true, mutter will attempt to replicate this
configuration the next time this HW layout appears.
(XXX: or is this gnome-settings-daemon role?)
@crtcs represents the new logical configuration, as a list
of structures containing:
- u ID: the API ID from the corresponding GetResources() call
- i new_mode: the API ID of the new mode to configure the CRTC
with, or -1 if the CRTC should be disabled
- i x, y: the new coordinates of the top left corner
the geometry will be completed with the size information
from @new_mode
- u transform: the desired transform
- au outputs: the API ID of outputs that should be assigned to
this CRTC
- a{sv} properties: properties whose value should be changed
Note: CRTCs not referenced in the array will be disabled.
@outputs represent the output property changes as:
- u ID: the API ID of the output to change
- a{sv} properties: properties whose value should be changed
Note: both for CRTCs and outputs, properties not included in
the dictionary will not be changed.
Note: unrecognized properties will have no effect, but if the
configuration change succeeds the property will be reported
by the next GetResources() call, and if @persistent is true,
it will also be saved to disk.
If the configuration is invalid according to the previous
GetResources() call, for example because a CRTC references
an output it cannot drive, or not all outputs support the
chosen mode, the error org.freedesktop.DBus.InvalidArgs will
be generated.
If the configuration cannot be applied for any other reason
(eg. the screen size would exceed texture limits), the error
org.freedesktop.DBus.Error.LimitsExceeded will be generated.
-->
<method name="ApplyConfiguration">
<arg name="serial" direction="in" type="u" />
<arg name="persistent" direction="in" type="b" />
<arg name="crtcs" direction="in" type="a(uiiiuaua{sv})" />
<arg name="outputs" direction="in" type="a(ua{sv})" />
</method>
<!--
ChangeBacklight:
@serial: configuration serial
@output: the API id of the output
@value: the new backlight value
Changes the backlight of @output to @value, which is
expressed as a percentage and rounded to the HW limits.
-->
<method name="ChangeBacklight">
<arg name="serial" direction="in" type="u" />
<arg name="output" direction="in" type="u" />
<arg name="value" direction="in" type="i" />
</method>
<!--
GetCrtcGamma:
@serial: configuration serial
@crtc: API id of the crtc
@red: red gamma ramp
@green: green gamma ramp
@blue: blue gamma ramp