[mutter/gnome-3-14] xrandr: ignore hotplug_mode_update value
- From: Jonathon Jongsma <jjongsma src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/gnome-3-14] xrandr: ignore hotplug_mode_update value
- Date: Wed, 5 Nov 2014 22:45:53 +0000 (UTC)
commit 4d08e89c16c65ac1bb0cf062a535dc956c2afae0
Author: Jonathon Jongsma <jjongsma redhat com>
Date: Wed Nov 5 11:42:15 2014 -0600
xrandr: ignore hotplug_mode_update value
The important thing is whether this property exists or not, but the value
doesn't matter.
src/backends/x11/meta-monitor-manager-xrandr.c | 26 +++++++++++++++++++++++-
1 files changed, 25 insertions(+), 1 deletions(-)
---
diff --git a/src/backends/x11/meta-monitor-manager-xrandr.c b/src/backends/x11/meta-monitor-manager-xrandr.c
index 21b9567..a8ac467 100644
--- a/src/backends/x11/meta-monitor-manager-xrandr.c
+++ b/src/backends/x11/meta-monitor-manager-xrandr.c
@@ -141,6 +141,30 @@ meta_monitor_transform_from_xrandr_all (Rotation rotation)
}
static gboolean
+output_get_property_exists (MetaMonitorManagerXrandr *manager_xrandr,
+ MetaOutput *output, const char *propname)
+{
+ gboolean exists = FALSE;
+ Atom atom, actual_type;
+ int actual_format;
+ unsigned long nitems, bytes_after;
+ unsigned char *buffer;
+
+ atom = XInternAtom (manager_xrandr->xdisplay, propname, False);
+ XRRGetOutputProperty (manager_xrandr->xdisplay,
+ (XID)output->winsys_id,
+ atom,
+ 0, G_MAXLONG, False, False, AnyPropertyType,
+ &actual_type, &actual_format,
+ &nitems, &bytes_after, &buffer);
+
+ exists = (actual_type != None);
+
+ XFree (buffer);
+ return exists;
+}
+
+static gboolean
output_get_boolean_property (MetaMonitorManagerXrandr *manager_xrandr,
MetaOutput *output, const char *propname)
{
@@ -330,7 +354,7 @@ static gboolean
output_get_hotplug_mode_update (MetaMonitorManagerXrandr *manager_xrandr,
MetaOutput *output)
{
- return output_get_boolean_property (manager_xrandr, output, "hotplug_mode_update");
+ return output_get_property_exists (manager_xrandr, output, "hotplug_mode_update");
}
static char *
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]