summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiovanni Campagna <gcampagn@redhat.com>2013-08-20 13:25:42 +0200
committerGiovanni Campagna <gcampagn@redhat.com>2013-08-20 14:08:50 +0200
commiteeb3dfc991711d2b601e1c99df2001f4d013d697 (patch)
treeedcf1d0218b8482d1278d88aec28f15f3eda3ef4
parente66db2eab3c189e6ec53d562b1f1a27beb8e6a8a (diff)
downloadmutter-eeb3dfc991711d2b601e1c99df2001f4d013d697.tar.gz
MonitorManager: emit a DBus signal when we change the display configuration
Using out-of-band notifications from the wayland protocol or from X is racy, in that the client could ask for the new resources before we have them. Instead, with a signal, we are sure that when the client asks for it, it will get the right values. https://bugzilla.gnome.org/show_bug.cgi?id=706382
-rw-r--r--src/core/monitor.c11
-rw-r--r--src/xrandr.xml9
2 files changed, 10 insertions, 10 deletions
diff --git a/src/core/monitor.c b/src/core/monitor.c
index d1a128320..e3e81ab0c 100644
--- a/src/core/monitor.c
+++ b/src/core/monitor.c
@@ -42,7 +42,6 @@
#define ALL_WL_TRANSFORMS ((1 << (WL_OUTPUT_TRANSFORM_FLIPPED_270 + 1)) - 1)
enum {
- MONITORS_CHANGED,
CONFIRM_DISPLAY_CHANGE,
SIGNALS_LAST
};
@@ -660,14 +659,6 @@ meta_monitor_manager_class_init (MetaMonitorManagerClass *klass)
klass->get_edid_file = get_edid_file_dummy;
klass->read_edid = read_edid_dummy;
- signals[MONITORS_CHANGED] =
- g_signal_new ("monitors-changed",
- G_TYPE_FROM_CLASS (object_class),
- G_SIGNAL_RUN_LAST,
- 0,
- NULL, NULL, NULL,
- G_TYPE_NONE, 0);
-
signals[CONFIRM_DISPLAY_CHANGE] =
g_signal_new ("confirm-display-change",
G_TYPE_FROM_CLASS (object_class),
@@ -1497,7 +1488,7 @@ invalidate_logical_config (MetaMonitorManager *manager)
make_logical_config (manager);
- g_signal_emit (manager, signals[MONITORS_CHANGED], 0);
+ g_signal_emit_by_name (manager, "monitors-changed");
g_free (old_monitor_infos);
}
diff --git a/src/xrandr.xml b/src/xrandr.xml
index aa07464d2..d8574ad7c 100644
--- a/src/xrandr.xml
+++ b/src/xrandr.xml
@@ -277,5 +277,14 @@
XRandR interface directly).
-->
<property name="PowerSaveMode" type="i" access="readwrite" />
+
+ <!--
+ MonitorsChanged:
+
+ The signal is emitted every time the screen configuration
+ changes.
+ The client should then call GetResources() to read the new layout.
+ -->
+ <signal name="MonitorsChanged" />
</interface>
</node>