X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2FXrrOutput.c;h=f13a9327a6a277bd49ed091c10597050c888d39b;hb=c669d0c45878eb25b0ed0eacf7c51922985cb634;hp=18863bdafdd4beb8834adfc1199f825dd28a375d;hpb=038b745f507eaa3a88a61375494e1c027365764f;p=framework%2Fuifw%2Fxorg%2Flib%2Flibxrandr.git diff --git a/src/XrrOutput.c b/src/XrrOutput.c index 18863bd..f13a932 100644 --- a/src/XrrOutput.c +++ b/src/XrrOutput.c @@ -34,7 +34,7 @@ #include "Xrandrint.h" #define OutputInfoExtra (SIZEOF(xRRGetOutputInfoReply) - 32) - + XRROutputInfo * XRRGetOutputInfo (Display *dpy, XRRScreenResources *resources, RROutput output) { @@ -67,8 +67,8 @@ XRRGetOutputInfo (Display *dpy, XRRScreenResources *resources, RROutput output) rep.nClones * 4 + ((rep.nameLength + 3) & ~3)); - /* - * first we must compute how much space to allocate for + /* + * first we must compute how much space to allocate for * randr library's use; we'll allocate the structures in a single * allocation, on cleanlyness grounds. */ @@ -105,19 +105,20 @@ XRRGetOutputInfo (Display *dpy, XRRScreenResources *resources, RROutput output) _XRead32 (dpy, xoi->crtcs, rep.nCrtcs << 2); _XRead32 (dpy, xoi->modes, rep.nModes << 2); _XRead32 (dpy, xoi->clones, rep.nClones << 2); - + /* * Read name and '\0' terminate */ _XReadPad (dpy, xoi->name, rep.nameLength); xoi->name[rep.nameLength] = '\0'; - + xoi->nameLen = rep.nameLength; + /* * Skip any extra data */ if (nbytes > nbytesRead) _XEatData (dpy, (unsigned long) (nbytes - nbytesRead)); - + UnlockDisplay (dpy); SyncHandle (); return (XRROutputInfo *) xoi; @@ -144,7 +145,7 @@ XRRSetOutputPrimary(Display *dpy, Window window, RROutput output) RRSimpleCheckExtension (dpy, info); - if (!XRRQueryVersion (dpy, &major_version, &minor_version) || + if (!XRRQueryVersion (dpy, &major_version, &minor_version) || !_XRRHasOutputPrimary (major_version, minor_version)) return; @@ -169,7 +170,7 @@ XRRGetOutputPrimary(Display *dpy, Window window) RRCheckExtension (dpy, info, 0); - if (!XRRQueryVersion (dpy, &major_version, &minor_version) || + if (!XRRQueryVersion (dpy, &major_version, &minor_version) || !_XRRHasOutputPrimary (major_version, minor_version)) return None; @@ -181,7 +182,7 @@ XRRGetOutputPrimary(Display *dpy, Window window) if (!_XReply (dpy, (xReply *) &rep, 0, xFalse)) rep.output = None; - + UnlockDisplay(dpy); SyncHandle();