Skip to content

Commit

Permalink
Merge pull request #12 from jumper149/scg
Browse files Browse the repository at this point in the history
fixing a lot in scg, fixes #9, fixes #10, fixes #11
  • Loading branch information
jumper149 authored Jan 26, 2020
2 parents 44b908e + 1d163f3 commit d784c1f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion backends/scg/scg.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@

int main(int argc, char **argv) {
Display *dpy = XOpenDisplay(NULL);

if(dpy == NULL) {
return 12; // exit code 12, if no display is found
}

int screen = DefaultScreen(dpy);
Window root = RootWindow(dpy, screen);

Expand All @@ -29,7 +34,6 @@ int main(int argc, char **argv) {
int num_crtcs = res->ncrtc;
for (int c = 0; c < res->ncrtc; c++) {
int crtcxid = res->crtcs[c];
XRRCrtcInfo *crtc_info = XRRGetCrtcInfo(dpy, res, crtcxid);

int size = XRRGetCrtcGammaSize(dpy, crtcxid);

Expand All @@ -45,6 +49,8 @@ int main(int argc, char **argv) {

XFree(crtc_gamma);
}
XRRFreeScreenResources(res);
XCloseDisplay(dpy);
return 0;
}

Expand Down

0 comments on commit d784c1f

Please sign in to comment.