[gnome-desktop] GnomeRR: use a DBus signal instead of XRandR events to refresh
- From: Giovanni Campagna <gcampagna src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-desktop] GnomeRR: use a DBus signal instead of XRandR events to refresh
- Date: Tue, 20 Aug 2013 11:56:05 +0000 (UTC)
commit ab2e60a60da70ab70941615835806d1c0fcca3b5
Author: Giovanni Campagna <gcampagn redhat com>
Date: Tue Aug 20 13:28:30 2013 +0200
GnomeRR: use a DBus signal instead of XRandR events to refresh
Using a DBus signal we avoid the race, and make sure that we
get the updated values in the next call to mutter.
https://bugzilla.gnome.org/show_bug.cgi?id=706383
libgnome-desktop/gnome-rr.c | 6 +++---
libgnome-desktop/xrandr.xml | 11 +++++++++--
2 files changed, 12 insertions(+), 5 deletions(-)
---
diff --git a/libgnome-desktop/gnome-rr.c b/libgnome-desktop/gnome-rr.c
index 2d1613a..5b56ff4 100644
--- a/libgnome-desktop/gnome-rr.c
+++ b/libgnome-desktop/gnome-rr.c
@@ -540,7 +540,7 @@ screen_update (GnomeRRScreen *screen, gboolean force_callback, GError **error)
}
static void
-screen_on_monitors_changed (GdkScreen *gdk_screen,
+screen_on_monitors_changed (MetaDBusDisplayConfig *proxy,
gpointer data)
{
GnomeRRScreen *screen = data;
@@ -569,7 +569,7 @@ gnome_rr_screen_initable_init (GInitable *initable, GCancellable *canc, GError *
if (!priv->info)
return FALSE;
- g_signal_connect_object (priv->gdk_screen, "monitors-changed",
+ g_signal_connect_object (priv->proxy, "monitors-changed",
G_CALLBACK (screen_on_monitors_changed), self, 0);
return TRUE;
}
@@ -596,7 +596,7 @@ on_proxy_acquired (GObject *object,
if (!priv->info)
return g_task_return_error (task, error);
- g_signal_connect_object (priv->gdk_screen, "monitors-changed",
+ g_signal_connect_object (priv->proxy, "monitors-changed",
G_CALLBACK (screen_on_monitors_changed), self, 0);
g_task_return_boolean (task, TRUE);
}
diff --git a/libgnome-desktop/xrandr.xml b/libgnome-desktop/xrandr.xml
index b0db9a0..d8574ad 100644
--- a/libgnome-desktop/xrandr.xml
+++ b/libgnome-desktop/xrandr.xml
@@ -149,11 +149,9 @@
@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:
@@ -279,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>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]