diff options
author | Adam Jackson <ajax@redhat.com> | 2008-11-24 16:11:46 -0500 |
---|---|---|
committer | Adam Jackson <ajax@redhat.com> | 2008-11-24 16:11:46 -0500 |
commit | 908de8fc7228ecc7b02825ebede5fb937f3abf1b (patch) | |
tree | 8cfd40eaf6ac5c26698fc321dc77f6e0b45203f1 /src | |
parent | f176b2bda103f6f38aabab8207f47a02cc797659 (diff) |
Add GetScreenResourcesCurrent
Diffstat (limited to 'src')
-rw-r--r-- | src/XrrScreen.c | 23 |
1 files changed, 20 insertions, 3 deletions
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) { |