summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/X11/extensions/Xrandr.h5
-rw-r--r--src/XrrScreen.c23
2 files changed, 25 insertions, 3 deletions
diff --git a/include/X11/extensions/Xrandr.h b/include/X11/extensions/Xrandr.h
index 77a7d04..0a75576 100644
--- a/include/X11/extensions/Xrandr.h
+++ b/include/X11/extensions/Xrandr.h
@@ -378,6 +378,11 @@ XRRFreeGamma (XRRCrtcGamma *gamma);
*/
int XRRUpdateConfiguration(XEvent *event);
+/* Version 1.3 additions */
+
+XRRScreenResources *
+XRRGetScreenResourcesCurrent (Display *dpy, Window window);
+
_XFUNCPROTOEND
#endif /* _XRANDR_H_ */
diff --git a/src/XrrScreen.c b/src/XrrScreen.c
index c9f5204..df49bb5 100644
--- a/src/XrrScreen.c
+++ b/src/XrrScreen.c
@@ -32,8 +32,12 @@
#include <X11/extensions/Xrender.h>
#include "Xrandrint.h"
-XRRScreenResources *
-XRRGetScreenResources (Display *dpy, Window window)
+/*
+ * this is cheating on the knowledge that the two requests are identical
+ * but for the request number.
+ */
+static XRRScreenResources *
+doGetScreenResources (Display *dpy, Window window, int poll)
{
XExtDisplayInfo *info = XRRFindDisplay(dpy);
xRRGetScreenResourcesReply rep;
@@ -75,7 +79,8 @@ XRRGetScreenResources (Display *dpy, Window window)
GetReq (RRGetScreenResources, req);
req->reqType = info->codes->major_opcode;
- req->randrReqType = X_RRGetScreenResources;
+ req->randrReqType = poll ? X_RRGetScreenResources
+ : X_RRGetScreenResourcesCurrent;
req->window = window;
if (!_XReply (dpy, (xReply *) &rep, 0, xFalse))
@@ -187,6 +192,18 @@ XRRGetScreenResources (Display *dpy, Window window)
return (XRRScreenResources *) xrsr;
}
+XRRScreenResources *
+XRRGetScreenResources(Display *dpy, Window window)
+{
+ return doGetScreenResources(dpy, window, 1);
+}
+
+XRRScreenResources *
+XRRGetScreenResourcesCurrent(Display *dpy, Window window)
+{
+ return doGetScreenResources(dpy, window, 0);
+}
+
void
XRRFreeScreenResources (XRRScreenResources *resources)
{