summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2007-07-13 10:23:07 -0700
committerEric Anholt <eric@anholt.net>2007-07-13 10:23:51 -0700
commit0070192418fc18f46b3446f934869079107d2ff7 (patch)
tree03d6798a5b6a87f21a96407a8d9e6f40dead1b50
parent126143add5349fc34488b23d54d1bdcc7e8847b9 (diff)
downloadxorg-lib-libXrandr-randr-dpms.tar.gz
Add the 1.3 output dpms change notify event.randr-dpms
-rw-r--r--configure.ac2
-rw-r--r--include/X11/extensions/Xrandr.h11
-rw-r--r--src/Xrandr.c21
3 files changed, 29 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac
index 16e5a14..5ed42b0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -32,7 +32,7 @@ dnl try to keep these the same. Note that the library has an extra
dnl digit in the version number to track changes which don't affect the
dnl protocol, so Xrandr version l.n.m corresponds to protocol version l.n
dnl
-AC_INIT(libXrandr, 1.2.1, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], libXrandr)
+AC_INIT(libXrandr, 1.3, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], libXrandr)
AC_CONFIG_AUX_DIR(.)
AM_INIT_AUTOMAKE([dist-bzip2])
AM_MAINTAINER_MODE
diff --git a/include/X11/extensions/Xrandr.h b/include/X11/extensions/Xrandr.h
index d87976b..16d7836 100644
--- a/include/X11/extensions/Xrandr.h
+++ b/include/X11/extensions/Xrandr.h
@@ -116,6 +116,17 @@ typedef struct {
int state; /* NewValue, Deleted */
} XRROutputPropertyNotifyEvent;
+typedef struct {
+ int type; /* event base */
+ unsigned long serial; /* # of last request processed by server */
+ Bool send_event; /* true if this came from a SendEvent request */
+ Display *display; /* Display the event was read from */
+ Window window; /* window which selected for this event */
+ int subtype; /* RRNotify_OutputDPMSChange */
+ RROutput output; /* affected output */
+ CARD16 level; /* New DPMS level */
+} XRROutputDPMSChangeNotifyEvent;
+
/* internal representation is private to the library */
typedef struct _XRRScreenConfiguration XRRScreenConfiguration;
diff --git a/src/Xrandr.c b/src/Xrandr.c
index fdaa80d..f6c804d 100644
--- a/src/Xrandr.c
+++ b/src/Xrandr.c
@@ -129,12 +129,18 @@ static Bool XRRWireToEvent(Display *dpy, XEvent *event, xEvent *wire)
aevent->state = awire->state;
return True;
}
-
- break;
+ case RRNotify_OutputDPMSChange: {
+ XRROutputDPMSChangeNotifyEvent *aevent =
+ (XRROutputDPMSChangeNotifyEvent *) event;
+ xRROutputDPMSChangeNotifyEvent *awire =
+ (xRROutputDPMSChangeNotifyEvent *) wire;
+ aevent->output = awire->output;
+ aevent->level = awire->level;
+ return True;
}
- }
+ } /* RRNotify subtype switch */
+ } /* RRNotify */
}
-
return False;
}
@@ -204,6 +210,13 @@ static Status XRREventToWire(Display *dpy, XEvent *event, xEvent *wire)
awire->state = aevent->state;
return True;
}
+ case RRNotify_OutputDPMSChange: {
+ xRROutputDPMSChangeNotifyEvent *awire = (xRROutputDPMSChangeNotifyEvent *) wire;
+ XRROutputDPMSChangeNotifyEvent *aevent = (XRROutputDPMSChangeNotifyEvent *) event;
+ awire->output = aevent->output;
+ awire->level = aevent->level;
+ return True;
+ }
}
}
}